@useinsider/guido 3.23.0 → 3.24.0-beta.1bbe7b9

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 (131) hide show
  1. package/README.md +8 -1
  2. package/dist/@types/config/schemas.js +43 -40
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +4 -4
  5. package/dist/components/Guido.vue2.js +113 -96
  6. package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
  8. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
  15. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  16. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  17. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  18. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  19. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  20. package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
  21. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  22. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +99 -0
  23. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  24. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  25. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  26. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  27. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  28. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  29. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  30. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  31. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  32. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  33. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  34. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  35. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  36. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  37. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  38. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
  39. package/dist/composables/useAccessibilityApi.js +51 -0
  40. package/dist/composables/useBlocksConfig.js +31 -20
  41. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  42. package/dist/composables/useDisplayConditions.js +117 -0
  43. package/dist/composables/useHtmlCompiler.js +2 -0
  44. package/dist/composables/useStripo.js +70 -70
  45. package/dist/composables/useTranslations.js +2 -1
  46. package/dist/config/compiler/htmlCompilerRules.js +14 -6
  47. package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
  48. package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
  49. package/dist/config/i18n/en/labels.json.js +36 -4
  50. package/dist/config/i18n/en/tooltips.json.js +2 -1
  51. package/dist/enums/academy.js +1 -0
  52. package/dist/enums/display-condition.js +12 -0
  53. package/dist/extensions/DisplayConditions/bridge.js +25 -0
  54. package/dist/extensions/DisplayConditions/constants.js +26 -0
  55. package/dist/extensions/DisplayConditions/control.js +215 -0
  56. package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
  57. package/dist/extensions/DisplayConditions/extension.js +28 -0
  58. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  59. package/dist/extensions/DisplayConditions/library.js +30 -0
  60. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  61. package/dist/extensions/LinkTracking/extension.js +17 -0
  62. package/dist/extensions/LinkTracking/writer.js +41 -0
  63. package/dist/guido.css +1 -1
  64. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
  65. package/dist/node_modules/valibot/dist/index.js +297 -261
  66. package/dist/package.json.js +2 -2
  67. package/dist/services/displayConditionApi.js +39 -0
  68. package/dist/sprite.svg +10 -0
  69. package/dist/src/@types/config/schemas.d.ts +6 -0
  70. package/dist/src/@types/display-condition.d.ts +60 -0
  71. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
  72. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  73. package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
  74. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  75. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  76. package/dist/src/components/organisms/header/AutoSaveStatus.vue.d.ts +2 -0
  77. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  78. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
  79. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
  80. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  81. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  82. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  83. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  84. package/dist/src/composables/useActionsApi.d.ts +2 -2
  85. package/dist/src/composables/useConfig.d.ts +4 -0
  86. package/dist/src/composables/useDisplayConditions.d.ts +18 -0
  87. package/dist/src/composables/useStripo.d.ts +1 -1
  88. package/dist/src/enums/academy.d.ts +1 -0
  89. package/dist/src/enums/display-condition.d.ts +15 -0
  90. package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
  91. package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
  92. package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
  93. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  94. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  95. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  96. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  97. package/dist/src/extensions/LinkTracking/extension.d.ts +2 -0
  98. package/dist/src/extensions/LinkTracking/writer.d.ts +13 -0
  99. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  100. package/dist/src/services/displayConditionApi.d.ts +8 -0
  101. package/dist/src/stores/autosave.d.ts +73 -1
  102. package/dist/src/stores/config.d.ts +187 -0
  103. package/dist/src/stores/display-condition.d.ts +84 -0
  104. package/dist/src/stores/editor.d.ts +109 -0
  105. package/dist/src/stores/onboarding.d.ts +966 -35
  106. package/dist/src/stores/version-history.d.ts +1 -1
  107. package/dist/src/utils/displayCondition.d.ts +11 -0
  108. package/dist/src/utils/linkTrackingIds.d.ts +22 -5
  109. package/dist/src/utils/protectTableText.d.ts +2 -0
  110. package/dist/src/utils/templatePreparation.d.ts +1 -1
  111. package/dist/src/utils/timeUtil.d.ts +5 -8
  112. package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
  113. package/dist/static/stripo-runtime-manifest.json.js +1 -1
  114. package/dist/static/styles/components/accessibility.css.js +234 -0
  115. package/dist/static/styles/variables.css.js +2 -0
  116. package/dist/stores/autosave.js +12 -7
  117. package/dist/stores/config.js +13 -6
  118. package/dist/stores/display-condition.js +29 -0
  119. package/dist/stores/editor.js +8 -3
  120. package/dist/stores/onboarding.js +48 -22
  121. package/dist/utils/displayCondition.js +26 -0
  122. package/dist/utils/linkTrackingIds.js +82 -48
  123. package/dist/utils/pairProductVariables.js +30 -29
  124. package/dist/utils/protectTableText.js +22 -0
  125. package/dist/utils/templatePreparation.js +67 -57
  126. package/dist/utils/timeUtil.js +6 -17
  127. package/dist/utils/trimHrefWhitespace.js +10 -0
  128. package/package.json +2 -2
  129. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  130. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  131. /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → display-conditions/DisplayConditionCreateDrawer.vue.d.ts} +0 -0
@@ -1,15 +1,25 @@
1
- import { defineComponent as n } from "vue";
2
- import { useAutoSave as u } from "../../composables/useAutoSave.js";
3
- import { useSave as i } from "../../composables/useSave.js";
4
- import { useSaveValidationRollout as l } from "../../composables/useSaveValidationRollout.js";
5
- import { useConfigStore as m } from "../../stores/config.js";
6
- const d = /* @__PURE__ */ n({
1
+ import { defineComponent as c } from "vue";
2
+ import { useAutoSave as m } from "../../composables/useAutoSave.js";
3
+ import { useSave as f } from "../../composables/useSave.js";
4
+ import { useSaveValidationRollout as v } from "../../composables/useSaveValidationRollout.js";
5
+ import { useToaster as p } from "../../composables/useToaster.js";
6
+ import { useConfigStore as S } from "../../stores/config.js";
7
+ const A = /* @__PURE__ */ c({
7
8
  __name: "AutoSaveController",
8
- setup(f) {
9
- const { save: e, saveRawOnly: t } = i(), { isEnabled: r } = l(), a = m(), o = () => r.value && a.allowSaveWithErrors, s = () => o() ? t() : e(!1, !0);
10
- return u(s, { clearsChanges: () => !o() }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: r, configStore: a, isRawAutosave: o, backgroundSave: s };
9
+ setup(d, { expose: u }) {
10
+ const { save: e, saveRawOnly: t } = f(), { isEnabled: r } = v(), { handleError: a } = p(), s = S(), o = () => r.value && s.allowSaveWithErrors, n = () => o() ? t() : e(!1, !0);
11
+ m(n, { clearsChanges: () => !o() });
12
+ const i = async () => {
13
+ try {
14
+ return await e(!0);
15
+ } catch (l) {
16
+ a(l, "Failed to save template");
17
+ return;
18
+ }
19
+ };
20
+ return u({ saveSilent: i }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: r, handleError: a, configStore: s, isRawAutosave: o, backgroundSave: n, saveSilent: i };
11
21
  }
12
22
  });
13
23
  export {
14
- d as default
24
+ A as default
15
25
  };
@@ -0,0 +1,17 @@
1
+ import r from "./CodeEditorField.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, t = e._self._c, o = e._self._setupProxy;
5
+ return t("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [t("p", { staticClass: "guido-code-editor-field__label mt-0 mb-2 f-s-1 f-w-400 l-h-1 t-c-1" }, [e._v(" " + e._s(e.label) + " ")]), t(o.InCodeSnippet, { attrs: { code: e.value, disable: e.disabled, "focus-editor": !1, invalid: !!e.error, "invalid-message": e.error, options: o.options, size: { height: e.error ? 196 : 216 }, "syntax-check": !1 }, on: { input: o.onInput, ready: o.onReady } })], 1);
6
+ }, a = [], n = /* @__PURE__ */ s(
7
+ r,
8
+ i,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = n.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,41 @@
1
+ import { defineComponent as f, computed as m, nextTick as _ } from "vue";
2
+ import { InCodeSnippet as I } from "@useinsider/design-system-vue";
3
+ const S = /* @__PURE__ */ f({
4
+ __name: "CodeEditorField",
5
+ props: {
6
+ id: null,
7
+ label: null,
8
+ value: null,
9
+ placeholder: { default: "" },
10
+ error: { default: "" },
11
+ disabled: { type: Boolean, default: !1 }
12
+ },
13
+ emits: ["input"],
14
+ setup(r, { expose: a, emit: n }) {
15
+ const l = r, u = 700;
16
+ let t = null, e = null;
17
+ const d = m(() => ({
18
+ mode: "liquid",
19
+ lint: !1,
20
+ foldGutter: !1,
21
+ placeholder: l.placeholder
22
+ })), p = (o) => {
23
+ t = o;
24
+ }, s = (o) => {
25
+ n("input", o), e == null || e();
26
+ }, i = () => new Promise((o) => {
27
+ if (!t || t.state.doc.toString() === l.value) {
28
+ o(l.value);
29
+ return;
30
+ }
31
+ const c = setTimeout(() => e == null ? void 0 : e(), u);
32
+ e = () => {
33
+ clearTimeout(c), e = null, _(() => o(l.value));
34
+ };
35
+ });
36
+ return a({ read: i }), { __sfc: !0, props: l, emit: n, SANITIZED_INPUT_WAIT_MS: u, view: t, settleRead: e, options: d, onReady: p, onInput: s, read: i, InCodeSnippet: I };
37
+ }
38
+ });
39
+ export {
40
+ S as default
41
+ };
@@ -0,0 +1,30 @@
1
+ import a from "./DisplayConditionCreateDrawer.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var i = this, t = i._self._c, e = i._self._setupProxy;
6
+ return t(e.WpDrawer, { attrs: { id: "guido__display-condition-create-drawer", "description-status": "", "class-name": "guido-display-condition-create-drawer", size: "large", "close-on-outside-click": !1, "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.store.isCreateOpen, "title-text": e.trans(`${e.KEY}.create-title`) }, on: { cancelOrBackButtonEvent: e.close, onCloseEvent: e.close, primaryButtonEvent: function(o) {
7
+ return e.submit("inline");
8
+ }, secondaryButtonEvent: function(o) {
9
+ return e.submit("save");
10
+ } } }, [t("div", { staticClass: "guido-display-condition-create" }, [t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-name-input", name: "displayConditionName", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.trans(`${e.KEY}.condition-name`), "max-character-length": e.DISPLAY_CONDITION_LIMITS.NAME_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-name-placeholder`), "state-message": e.errors.name || "", states: e.errors.name ? "error" : "default", "tooltip-status": !1, value: e.draft.name }, on: { input: function(o) {
11
+ return e.updateField("name", o);
12
+ } } }), t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-description-input", name: "displayConditionDescription", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.descriptionLabel, "max-character-length": e.DISPLAY_CONDITION_LIMITS.DESCRIPTION_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-description-placeholder`), "state-message": e.errors.description || "", states: e.errors.description ? "error" : "default", "tooltip-status": !1, value: e.draft.description }, on: { input: function(o) {
13
+ return e.updateField("description", o);
14
+ } } }), t("div", { staticClass: "guido-display-condition-create__separator" }), t("p", { staticClass: "guido-display-condition-create__method-title mt-0 mb-4 f-s-1 f-w-600 l-h-6 l-s-5 t-t-u t-c-55" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(o) {
15
+ return e.updateField("codeBefore", o);
16
+ } } }), t(e.CodeEditorField, { ref: "codeAfterRef", attrs: { id: "guido__display-condition-code-after", disabled: e.isSaving, error: e.errors.codeAfter, label: e.trans(`${e.KEY}.code-after`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeAfter }, on: { input: function(o) {
17
+ return e.updateField("codeAfter", o);
18
+ } } })], 1)]);
19
+ }, s = [], d = /* @__PURE__ */ r(
20
+ a,
21
+ n,
22
+ s,
23
+ !1,
24
+ null,
25
+ "1d9700d1"
26
+ );
27
+ const f = d.exports;
28
+ export {
29
+ f as default
30
+ };
@@ -0,0 +1,81 @@
1
+ import { defineComponent as w, reactive as L, ref as c, computed as u, watch as N } from "vue";
2
+ import R from "../../wrappers/WpDrawer.vue.js";
3
+ import { useDisplayConditions as k, DISPLAY_CONDITIONS_TRANS_KEY as i } from "../../../composables/useDisplayConditions.js";
4
+ import { useTranslations as Y } from "../../../composables/useTranslations.js";
5
+ import { DISPLAY_CONDITION_LIMITS as j } from "../../../enums/display-condition.js";
6
+ import { useDisplayConditionStore as E } from "../../../stores/display-condition.js";
7
+ import { InRadioButton as P, InBasicTextInput as F } from "@useinsider/design-system-vue";
8
+ import G from "./CodeEditorField.vue.js";
9
+ const Z = /* @__PURE__ */ w({
10
+ __name: "DisplayConditionCreateDrawer",
11
+ setup(K) {
12
+ const n = Y(), p = E(), {
13
+ validate: v,
14
+ notifyInvalid: f,
15
+ createInline: y,
16
+ createAndSave: _,
17
+ cancel: b,
18
+ describeWithAcademyLink: B
19
+ } = k(), m = () => ({ name: "", description: "", codeBefore: "", codeAfter: "" }), e = L(m()), o = c({}), r = c(!1), l = c(!1), s = u(() => r.value || l.value), g = c(), I = c();
20
+ let d = 0;
21
+ N(() => p.isCreateOpen, (a) => {
22
+ if (d += 1, !a)
23
+ return;
24
+ const { editing: t } = p;
25
+ Object.assign(e, t ? {
26
+ name: t.name,
27
+ description: t.description,
28
+ codeBefore: t.beforeScript,
29
+ codeAfter: t.afterScript
30
+ } : m()), o.value = {}, r.value = !1;
31
+ }, { immediate: !0 });
32
+ const C = u(() => B("create-description")), D = u(() => ({
33
+ cancelOrBackButton: {
34
+ styling: "ghost",
35
+ type: "secondary",
36
+ labelText: n(`${i}.cancel`),
37
+ disabledStatus: s.value
38
+ },
39
+ secondaryButton: {
40
+ styling: "solid",
41
+ type: "subtle-primary",
42
+ labelText: n(`${i}.create-and-save`),
43
+ loadingStatus: r.value
44
+ },
45
+ primaryButton: {
46
+ styling: "solid",
47
+ type: "primary",
48
+ labelText: n(`${i}.create`),
49
+ disabledStatus: s.value
50
+ }
51
+ })), O = (a, t) => {
52
+ t !== e[a] && (e[a] = t, o.value[a] && (o.value = { ...o.value, [a]: void 0 }));
53
+ }, T = u(() => `${n(`${i}.condition-description`)} <span class="guido-display-condition-create__optional t-c-53">(${n(`${i}.optional`)})</span>`);
54
+ return { __sfc: !0, trans: n, store: p, validate: v, notifyInvalid: f, createInline: y, createAndSave: _, cancel: b, describeWithAcademyLink: B, emptyDraft: m, draft: e, errors: o, isSaving: r, isReadingCode: l, isBusy: s, codeBeforeRef: g, codeAfterRef: I, openGeneration: d, descriptionText: C, footerButtonGroupOptions: D, updateField: O, descriptionLabel: T, submit: async (a) => {
55
+ var S, A;
56
+ if (s.value)
57
+ return;
58
+ const t = d;
59
+ l.value = !0;
60
+ const [$, x] = await Promise.all([(S = g.value) == null ? void 0 : S.read(), (A = I.value) == null ? void 0 : A.read()]);
61
+ if (l.value = !1, t !== d)
62
+ return;
63
+ if (e.codeBefore = $ ?? e.codeBefore, e.codeAfter = x ?? e.codeAfter, o.value = v(e), Object.keys(o.value).length) {
64
+ f();
65
+ return;
66
+ }
67
+ if (a === "inline") {
68
+ y({ ...e });
69
+ return;
70
+ }
71
+ r.value = !0;
72
+ const h = await _({ ...e });
73
+ r.value = !1, o.value = h ?? {}, Object.keys(o.value).length && f();
74
+ }, close: () => {
75
+ s.value || b();
76
+ }, WpDrawer: R, KEY: i, DISPLAY_CONDITION_LIMITS: j, InBasicTextInput: F, InRadioButton: P, CodeEditorField: G };
77
+ }
78
+ });
79
+ export {
80
+ Z as default
81
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./DisplayConditionListState.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var e = this, i = e._self._c, t = e._self._setupProxy;
5
+ return i(t.InNoData, { staticClass: "d-f f-d-c j-c-c f-g-1", attrs: { id: t.view.id, "button-status": !!t.view.buttonText, "button-text": t.view.buttonText, description: t.view.description, icon: t.view.icon, title: t.view.title }, on: { click: t.onClick } });
6
+ }, r = [], c = /* @__PURE__ */ o(
7
+ n,
8
+ s,
9
+ r,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = c.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,45 @@
1
+ import { defineComponent as s, computed as a } from "vue";
2
+ import { DISPLAY_CONDITIONS_TRANS_KEY as e } from "../../../composables/useDisplayConditions.js";
3
+ import { useTranslations as c } from "../../../composables/useTranslations.js";
4
+ import { InNoData as p } from "@useinsider/design-system-vue";
5
+ const y = /* @__PURE__ */ s({
6
+ __name: "DisplayConditionListState",
7
+ props: {
8
+ state: null
9
+ },
10
+ emits: ["retry", "create"],
11
+ setup(i, { emit: r }) {
12
+ const o = i, t = c(), n = a(() => {
13
+ switch (o.state) {
14
+ case "error":
15
+ return {
16
+ id: "guido__display-condition-error",
17
+ icon: "no-data",
18
+ title: t(`${e}.error-load-title`),
19
+ description: t(`${e}.error-load`),
20
+ buttonText: t(`${e}.retry`)
21
+ };
22
+ case "empty":
23
+ return {
24
+ id: "guido__display-condition-empty",
25
+ icon: "no-personalization",
26
+ title: t(`${e}.empty-title`),
27
+ description: t(`${e}.empty-description`),
28
+ buttonText: t(`${e}.create-new`)
29
+ };
30
+ default:
31
+ return {
32
+ id: "guido__display-condition-no-result",
33
+ icon: "no-data",
34
+ title: t(`${e}.no-result`)
35
+ };
36
+ }
37
+ });
38
+ return { __sfc: !0, props: o, emit: r, trans: t, view: n, onClick: () => {
39
+ o.state === "error" ? r("retry") : o.state === "empty" && r("create");
40
+ }, InNoData: p };
41
+ }
42
+ });
43
+ export {
44
+ y as default
45
+ };
@@ -0,0 +1,36 @@
1
+ import o from "./DisplayConditionSelectDrawer.vue2.js";
2
+ /* empty css */
3
+ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "guido-display-condition-select-root" }, [e(t.WpDrawer, { attrs: { id: "guido__display-condition-select-drawer", "description-status": "", "class-name": "guido-display-condition-select-drawer", size: "large", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isSelectOpen, "title-text": t.trans(`${t.KEY}.select-title`) }, on: { cancelOrBackButtonEvent: t.cancel, onCloseEvent: t.cancel } }, [e("div", { staticClass: "guido-display-condition-select d-f f-d-c f-g-1" }, [t.store.listStatus === "loaded" && t.store.list.length ? e(t.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-search-input", name: "displayConditionSearch", "character-counter-status": !1, "label-status": !1, "placeholder-text": t.trans(`${t.KEY}.search`), "tooltip-status": !1, value: t.search }, on: { input: function(i) {
7
+ t.search = i;
8
+ } } }) : s._e(), t.store.listStatus === "loading" || t.store.listStatus === "idle" ? e("div", { staticClass: "guido-display-condition-select__list", attrs: { "data-testid": "display-condition-loading" } }, s._l(t.SKELETON_HEIGHTS, function(i, n) {
9
+ return e(t.InSkeleton, { key: n, attrs: { sizing: { width: 856, height: i } } });
10
+ }), 1) : t.listState ? e(t.DisplayConditionListState, { attrs: { state: t.listState }, on: { create: function(i) {
11
+ return t.store.openCreate();
12
+ }, retry: t.loadList } }) : e("ul", { staticClass: "guido-display-condition-select__list" }, s._l(t.filteredList, function(i) {
13
+ return e("li", { key: i.id, staticClass: "guido-display-condition-card bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4", attrs: { "data-condition-id": i.id } }, [e("div", { staticClass: "guido-display-condition-card__header" }, [e("div", { staticClass: "guido-display-condition-card__text" }, [e("p", { staticClass: "guido-display-condition-card__name m-0 f-s-13 f-w-600 l-h-2 t-c-55" }, [s._v(" " + s._s(i.name) + " ")]), i.description ? e("p", { staticClass: "guido-display-condition-card__description mt-1 mb-0 f-s-1 l-h-1 t-c-53" }, [s._v(" " + s._s(i.description) + " ")]) : s._e()]), e("div", { staticClass: "guido-display-condition-card__actions" }, [e("div", { staticClass: "guido-display-condition-card__split" }, [e(t.InButtonV2, { attrs: { id: `guido__display-condition-select-${i.id}`, type: "subtle-primary", "label-text": t.trans(`${t.KEY}.select`) }, on: { click: function(n) {
14
+ return t.select(i);
15
+ } } }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-menu-${i.id}`, "left-icon": "filled-dropdown-down", type: "subtle-primary", "label-text-status": !1 }, on: { click: function(n) {
16
+ return t.toggleMenu(i);
17
+ } } }), e(t.InDropdownMenu, { staticClass: "guido-display-condition-card__menu", attrs: { id: `guido__display-condition-menu-list-${i.id}`, "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, options: t.menuOptions(i), "select-all-option-status": !1, status: t.menuId === i.id }, on: { clickOutside: function(n) {
18
+ return t.closeMenu(i);
19
+ }, optionClick: function(n) {
20
+ return t.requestDelete(i);
21
+ } } })], 1), e("span", { staticClass: "guido-display-condition-card__divider" }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-expand-${i.id}`, styling: "text", type: "secondary", "label-text-status": !1, "left-icon": t.expandedId === i.id ? "filled-dropdown-up" : "filled-dropdown-down", "selected-status": t.expandedId === i.id, "tooltip-options": t.expandTooltip(i), "tooltip-text": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
22
+ return t.toggleExpanded(i);
23
+ } } })], 1)]), t.expandedId === i.id ? e("pre", { staticClass: "guido-display-condition-card__code bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4 f-s-2 l-h-2" }, [s._v(s._s(t.codeOf(i)))]) : s._e()]);
24
+ }), 0)], 1)]), t.store.pendingDelete ? e("div", { staticClass: "guido-display-condition-select__delete-modal" }, [e(t.WpModal, { attrs: { id: "guido__display-condition-delete-modal", size: "X-small", state: "danger", "close-on-outside-click": !1, "footer-button-options": t.deleteModalButtons, title: t.trans(`${t.KEY}.delete-confirm-title`) }, on: { close: t.closeDeleteModal, "primary-action": t.confirmDelete } }, [e("p", { staticClass: "guido-display-condition-select__delete-text m-0 t-c-55" }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete-confirm-description`, { name: t.store.pendingDelete.name })) + " ")])])], 1) : s._e()], 1);
25
+ }, l = [], c = /* @__PURE__ */ d(
26
+ o,
27
+ a,
28
+ l,
29
+ !1,
30
+ null,
31
+ "62c5ac25"
32
+ );
33
+ const f = c.exports;
34
+ export {
35
+ f as default
36
+ };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as T, ref as r, watch as I, computed as i } from "vue";
2
+ import O from "../../wrappers/WpDrawer.vue.js";
3
+ import B from "../../wrappers/WpModal.vue.js";
4
+ import { useDisplayConditions as L, DISPLAY_CONDITIONS_TRANS_KEY as s } from "../../../composables/useDisplayConditions.js";
5
+ import { useTranslations as M } from "../../../composables/useTranslations.js";
6
+ import { useDisplayConditionStore as h } from "../../../stores/display-condition.js";
7
+ import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
8
+ import { InSkeleton as $, InDropdownMenu as E, InButtonV2 as b, InBasicTextInput as k } from "@useinsider/design-system-vue";
9
+ import w from "./DisplayConditionListState.vue.js";
10
+ const ee = /* @__PURE__ */ T({
11
+ __name: "DisplayConditionSelectDrawer",
12
+ setup(A) {
13
+ const g = [40, 76, 76, 76], l = M(), t = h(), { loadList: c, select: v, deleteSaved: d, cancel: D, describeWithAcademyLink: p } = L(), u = r(""), a = r(null), n = r(null), o = r(!1);
14
+ I(() => t.isSelectOpen, (e) => {
15
+ e && (u.value = "", a.value = null, n.value = null, c());
16
+ }, { immediate: !0 });
17
+ const f = i(() => {
18
+ const e = u.value.trim().toLocaleLowerCase();
19
+ return e ? t.list.filter((m) => `${m.name} ${m.description}`.toLocaleLowerCase().includes(e)) : t.list;
20
+ }), y = i(() => t.listStatus === "error" ? "error" : t.list.length ? f.value.length ? null : "no-result" : "empty"), _ = i(() => p("select-description")), S = i(() => ({
21
+ cancelOrBackButton: {
22
+ styling: "ghost",
23
+ type: "secondary",
24
+ labelText: l(`${s}.back`),
25
+ leftIcon: "line-arrow-left"
26
+ }
27
+ })), x = i(() => ({
28
+ cancelOrBackButton: {
29
+ type: "secondary",
30
+ styling: "ghost",
31
+ labelText: l(`${s}.cancel`),
32
+ disabledStatus: o.value
33
+ },
34
+ primaryButton: {
35
+ type: "danger",
36
+ labelText: l(`${s}.delete`),
37
+ loadingStatus: o.value
38
+ }
39
+ }));
40
+ return { __sfc: !0, SKELETON_HEIGHTS: g, trans: l, store: t, loadList: c, select: v, deleteSaved: d, cancel: D, describeWithAcademyLink: p, search: u, expandedId: a, menuId: n, isDeleting: o, filteredList: f, listState: y, descriptionText: _, footerButtonGroupOptions: S, deleteModalButtons: x, toggleExpanded: (e) => {
41
+ a.value = a.value === e.id ? null : e.id;
42
+ }, toggleMenu: (e) => {
43
+ n.value = n.value === e.id ? null : e.id;
44
+ }, closeMenu: (e) => {
45
+ n.value === e.id && (n.value = null);
46
+ }, expandTooltip: (e) => C(
47
+ `guido__display-condition-expand-tooltip-${e.id}`,
48
+ { staticPosition: "top right" }
49
+ ), menuOptions: (e) => [
50
+ { text: l(`${s}.delete`), value: `guido__display-condition-delete-${e.id}` }
51
+ ], requestDelete: (e) => {
52
+ n.value = null, t.pendingDelete = e;
53
+ }, confirmDelete: async () => {
54
+ !t.pendingDelete || o.value || (o.value = !0, await d(t.pendingDelete), o.value = !1);
55
+ }, closeDeleteModal: () => {
56
+ o.value || (t.pendingDelete = null);
57
+ }, codeOf: (e) => [e.codeBefore, e.codeAfter].filter(Boolean).join(`
58
+ `), WpDrawer: O, WpModal: B, KEY: s, InBasicTextInput: k, InButtonV2: b, InDropdownMenu: E, InSkeleton: $, DisplayConditionListState: w };
59
+ }
60
+ });
61
+ export {
62
+ ee as default
63
+ };
@@ -0,0 +1,17 @@
1
+ import e from "./DisplayConditionsHost.vue2.js";
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var s = this, o = s._self._c, t = s._self._setupProxy;
5
+ return o("div", { staticClass: "guido-display-conditions-host" }, [o(t.DisplayConditionCreateDrawer), o(t.DisplayConditionSelectDrawer)], 1);
6
+ }, i = [], a = /* @__PURE__ */ n(
7
+ e,
8
+ r,
9
+ i,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const p = a.exports;
15
+ export {
16
+ p as default
17
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as i, onMounted as s, onBeforeUnmount as m } from "vue";
2
+ import { useDisplayConditions as p } from "../../../composables/useDisplayConditions.js";
3
+ import { DisplayConditionEvent as n } from "../../../enums/display-condition.js";
4
+ import { useDisplayConditionStore as a } from "../../../stores/display-condition.js";
5
+ import d from "./DisplayConditionCreateDrawer.vue.js";
6
+ import f from "./DisplayConditionSelectDrawer.vue.js";
7
+ const E = /* @__PURE__ */ i({
8
+ __name: "DisplayConditionsHost",
9
+ setup(l) {
10
+ const o = a(), { handleOpen: t } = p(), e = (r) => {
11
+ t(r.detail);
12
+ };
13
+ return s(() => {
14
+ o.$reset(), document.addEventListener(n.OPEN, e);
15
+ }), m(() => {
16
+ document.removeEventListener(n.OPEN, e), o.$reset();
17
+ }), { __sfc: !0, store: o, handleOpen: t, onOpen: e, DisplayConditionCreateDrawer: d, DisplayConditionSelectDrawer: f };
18
+ }
19
+ });
20
+ export {
21
+ E as default
22
+ };
@@ -0,0 +1,17 @@
1
+ import t from "./AutoSaveStatus.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var s = this, e = s._self._c, a = s._self._setupProxy;
5
+ return a.isFeatureEnabled("autosave") ? e("div", { staticClass: "d-f a-i-c auto-save-status" }, [a.autosaveStore.status === a.AUTOSAVE_STATUS.SAVING ? e("span", { staticClass: "d-f a-i-c f-s-1" }, [e(a.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), e("span", { staticClass: "ml-1 t-c-53" }, [s._v(s._s(a.trans("newsletter.saving")))])], 1) : a.savedLabel ? e("span", { staticClass: "f-s-1 t-c-53" }, [s._v(s._s(a.savedLabel.before)), a.savedLabel.word ? e("span", { staticClass: "f-w-600" }, [s._v(s._s(a.savedLabel.word))]) : s._e(), s._v(s._s(a.savedLabel.after))]) : s._e()]) : s._e();
6
+ }, n = [], o = /* @__PURE__ */ r(
7
+ t,
8
+ _,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const v = o.exports;
15
+ export {
16
+ v as default
17
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as p, computed as S } from "vue";
2
+ import { useConfig as A } from "../../../composables/useConfig.js";
3
+ import { useTranslations as T } from "../../../composables/useTranslations.js";
4
+ import { useAutosaveStore as v, AUTOSAVE_STATUS as m } from "../../../stores/autosave.js";
5
+ import { autoSaveTimestamp as b } from "../../../utils/timeUtil.js";
6
+ import { InLoading as D } from "@useinsider/design-system-vue";
7
+ const j = /* @__PURE__ */ p({
8
+ __name: "AutoSaveStatus",
9
+ setup(O) {
10
+ const { isFeatureEnabled: u } = A(), a = v(), n = T(), t = "__BOLD_START__", o = "__BOLD_END__", s = (i) => i.split(t).join("").split(o).join(""), _ = S(() => {
11
+ if (a.status !== m.SAVED || !a.lastSavedAt)
12
+ return null;
13
+ const { isToday: i, time: c, date: f } = b(a.lastSavedAt), l = { boldStart: t, boldEnd: o }, e = i ? n("email-editor.autosaved-at-today", { ...l, time: c }) : n("email-editor.autosaved-at-date", { ...l, date: f }), r = e.indexOf(t), d = e.indexOf(o, r + t.length);
14
+ return r === -1 || d === -1 ? { before: s(e), word: "", after: "" } : {
15
+ before: s(e.slice(0, r)),
16
+ word: s(e.slice(r + t.length, d)),
17
+ after: s(e.slice(d + o.length))
18
+ };
19
+ });
20
+ return { __sfc: !0, isFeatureEnabled: u, autosaveStore: a, trans: n, BOLD_START: t, BOLD_END: o, stripMarkers: s, savedLabel: _, AUTOSAVE_STATUS: m, InLoading: D };
21
+ }
22
+ });
23
+ export {
24
+ j as default
25
+ };
@@ -1,23 +1,23 @@
1
- import l from "./EditorActions.vue2.js";
1
+ import a from "./EditorActions.vue2.js";
2
2
  /* empty css */
3
- import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var u = function() {
5
- var s, i, n, a;
6
- var o = this, e = o._self._c, t = o._self._setupProxy;
7
- return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
3
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var d = function() {
5
+ var o, s;
6
+ var i = this, e = i._self._c, t = i._self._setupProxy;
7
+ return e("div", { staticClass: "d-f a-i-c editor-actions" }, [!t.editorStore.isPreviewModeOpen && t.hasContentOnTheLeft ? e("div", { staticClass: "editor-actions__divider" }) : i._e(), (s = (o = t.config) == null ? void 0 : o.features) != null && s.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : i._e(), e(t.EditorActionsMenu), t.editorStore.isPreviewModeOpen ? i._e() : e("div", { staticClass: "editor-actions__divider" }), t.editorStore.isPreviewModeOpen ? i._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(n) {
8
8
  return t.handleSave(!1);
9
- } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
9
+ } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(n) {
10
10
  return t.executeSave(!1);
11
11
  } } })], 1);
12
- }, p = [], c = /* @__PURE__ */ d(
12
+ }, l = [], c = /* @__PURE__ */ r(
13
+ a,
14
+ d,
13
15
  l,
14
- u,
15
- p,
16
16
  !1,
17
17
  null,
18
- "baf7a5dd"
18
+ "9a028d08"
19
19
  );
20
- const v = c.exports;
20
+ const p = c.exports;
21
21
  export {
22
- v as default
22
+ p as default
23
23
  };