@useinsider/guido 3.23.0-beta.5389d8c → 3.23.0-beta.57760f0
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.
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +42 -38
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +8 -10
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +23 -12
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +1 -1
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +51 -41
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +10 -10
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +42 -36
- package/dist/composables/useBlocksConfig.js +32 -29
- package/dist/composables/useDisplayConditions.js +46 -38
- package/dist/composables/useTranslations.js +2 -1
- package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
- package/dist/extensions/DisplayConditions/bridge.js +20 -13
- package/dist/extensions/DisplayConditions/control.js +69 -51
- package/dist/extensions/DisplayConditions/library.js +14 -11
- package/dist/extensions/LinkTracking/extension.js +17 -0
- package/dist/extensions/LinkTracking/writer.js +35 -0
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/@types/display-condition.d.ts +0 -1
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +1 -1
- package/dist/src/composables/useDisplayConditions.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +2 -1
- package/dist/src/extensions/DisplayConditions/control.d.ts +2 -0
- package/dist/src/extensions/LinkTracking/extension.d.ts +2 -0
- package/dist/src/extensions/LinkTracking/writer.d.ts +13 -0
- package/dist/src/utils/displayCondition.d.ts +4 -3
- package/dist/src/utils/linkTrackingIds.d.ts +20 -5
- package/dist/utils/displayCondition.js +13 -13
- package/dist/utils/linkTrackingIds.js +80 -47
- package/dist/utils/protectTableText.js +9 -9
- package/dist/utils/templatePreparation.js +67 -57
- package/package.json +1 -1
|
@@ -13,25 +13,27 @@ import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
|
13
13
|
import { RIBBON_SELECTOR as we } from "../enums/onboarding.js";
|
|
14
14
|
import { useRecommendationExtensionStore as V, disposeStrategyPageReturnListeners as ke } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
15
15
|
import { disposeUnsubscribeListeners as Ie } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
16
|
+
import { disposeDisplayConditionRequest as Re } from "../extensions/DisplayConditions/bridge.js";
|
|
17
|
+
import { disposeTrackingIdWriter as Te } from "../extensions/LinkTracking/writer.js";
|
|
16
18
|
import Fe from "./organisms/AutoSaveController.vue.js";
|
|
17
19
|
import Me from "./organisms/base/AuthErrorModal.vue.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { useStripoApi as
|
|
26
|
-
import { useConfigStore as
|
|
27
|
-
import { useDynamicContentStore as
|
|
20
|
+
import Le from "./organisms/base/Toaster.vue.js";
|
|
21
|
+
import Ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
22
|
+
import Ne from "./organisms/header/HeaderWrapper.vue.js";
|
|
23
|
+
import _e from "./organisms/LoadingWrapper.vue.js";
|
|
24
|
+
import xe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
25
|
+
import Ae from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
26
|
+
import Be from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
27
|
+
import { useStripoApi as Oe } from "../services/stripoApi.js";
|
|
28
|
+
import { useConfigStore as Pe } from "../stores/config.js";
|
|
29
|
+
import { useDynamicContentStore as We } from "../stores/dynamic-content.js";
|
|
28
30
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
29
|
-
import { usePreviewStore as
|
|
30
|
-
import { useSaveValidationStore as
|
|
31
|
-
import { useTemplateStore as
|
|
32
|
-
import { useUnsubscribeStore as
|
|
31
|
+
import { usePreviewStore as He } from "../stores/preview.js";
|
|
32
|
+
import { useSaveValidationStore as Ge } from "../stores/save-validation.js";
|
|
33
|
+
import { useTemplateStore as Ve } from "../stores/template.js";
|
|
34
|
+
import { useUnsubscribeStore as $e } from "../stores/unsubscribe.js";
|
|
33
35
|
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
34
|
-
const
|
|
36
|
+
const It = /* @__PURE__ */ le({
|
|
35
37
|
__name: "Guido",
|
|
36
38
|
props: {
|
|
37
39
|
config: null,
|
|
@@ -39,7 +41,7 @@ const Ct = /* @__PURE__ */ le({
|
|
|
39
41
|
},
|
|
40
42
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
41
43
|
setup(z, { expose: q, emit: a }) {
|
|
42
|
-
const s = z,
|
|
44
|
+
const s = z, n = ge(), K = d(
|
|
43
45
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
44
46
|
), j = d(
|
|
45
47
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
@@ -51,12 +53,12 @@ const Ct = /* @__PURE__ */ le({
|
|
|
51
53
|
() => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
|
|
52
54
|
), Y = d(
|
|
53
55
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
54
|
-
), D = W(), y = W(), g =
|
|
56
|
+
), D = W(), y = W(), g = We(), w = $e(), o = Pe();
|
|
55
57
|
s.ready && o.init(s.config);
|
|
56
|
-
const m = C(), Z =
|
|
58
|
+
const m = C(), Z = He(), u = p(() => m.hasChanges), { isTestPartner: ee } = be(), { isEnabled: te, loadRollout: k } = he(), I = () => {
|
|
57
59
|
var t;
|
|
58
60
|
return (t = D.value) == null ? void 0 : t.handleSave(!0);
|
|
59
|
-
},
|
|
61
|
+
}, R = (t) => {
|
|
60
62
|
m.loadingStatus = t;
|
|
61
63
|
};
|
|
62
64
|
fe(), Se();
|
|
@@ -70,12 +72,12 @@ const Ct = /* @__PURE__ */ le({
|
|
|
70
72
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
71
73
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
72
74
|
};
|
|
73
|
-
}, { initPlugin:
|
|
75
|
+
}, { initPlugin: T, preloadRuntime: F } = Ee(n), { runExclusive: M, beginMount: L, isCurrentMount: S } = ye();
|
|
74
76
|
let f = 0;
|
|
75
|
-
const { getDefaultTemplate: U } =
|
|
77
|
+
const { getDefaultTemplate: U } = Oe(), { cloneTimersOnSave: N, hasTimerBlocks: _ } = Ce(), oe = p(() => {
|
|
76
78
|
var t;
|
|
77
79
|
return !((t = o.ui) != null && t.showHeader);
|
|
78
|
-
}),
|
|
80
|
+
}), re = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ne = p(() => o.externalDisplayConditions), ae = p(
|
|
79
81
|
() => !!V().recommendationConfigs.strategyId
|
|
80
82
|
);
|
|
81
83
|
ve({
|
|
@@ -112,9 +114,9 @@ const Ct = /* @__PURE__ */ le({
|
|
|
112
114
|
(e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
113
115
|
}, E = async () => {
|
|
114
116
|
var t;
|
|
115
|
-
|
|
117
|
+
n.mark("host_ready");
|
|
116
118
|
try {
|
|
117
|
-
o.initialized || o.init(s.config), m.templateId = o.templateId,
|
|
119
|
+
o.initialized || o.init(s.config), m.templateId = o.templateId, n.setContext({
|
|
118
120
|
partnerName: o.partnerName,
|
|
119
121
|
productType: o.productType,
|
|
120
122
|
templateId: o.templateId,
|
|
@@ -126,33 +128,33 @@ const Ct = /* @__PURE__ */ le({
|
|
|
126
128
|
partnerName: o.partnerName,
|
|
127
129
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
128
130
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
129
|
-
}, P = (me) =>
|
|
131
|
+
}, P = (me) => n.timed(
|
|
130
132
|
"migration",
|
|
131
133
|
() => De(me, ie, se)
|
|
132
134
|
);
|
|
133
|
-
let
|
|
135
|
+
let r = {
|
|
134
136
|
html: i && await P(i),
|
|
135
137
|
css: l
|
|
136
138
|
};
|
|
137
|
-
|
|
138
|
-
const ce = O ? $(
|
|
139
|
-
_(
|
|
139
|
+
r.html || (r = await n.timed("default_template", () => U()), r.html = await P(r.html));
|
|
140
|
+
const ce = O ? $(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
141
|
+
_(r.html) && (r.html = await n.timed("timer_clone", () => N(r.html))), O && (m.trackIdSessionFloor = Math.max(ce, $(r.html)));
|
|
140
142
|
const de = {
|
|
141
143
|
preselectedDynamicContentList: B,
|
|
142
144
|
onReady: () => {
|
|
143
145
|
console.debug("guido:ready"), a("ready");
|
|
144
146
|
}
|
|
145
147
|
};
|
|
146
|
-
f = L(), await
|
|
148
|
+
f = L(), await T(r, v(), de), g.selectedDynamicContentList = B;
|
|
147
149
|
} catch (e) {
|
|
148
|
-
console.error("Failed to initialize Stripo editor:", e),
|
|
150
|
+
console.error("Failed to initialize Stripo editor:", e), n.markFailed();
|
|
149
151
|
}
|
|
150
152
|
};
|
|
151
153
|
return pe(async () => {
|
|
152
154
|
var e;
|
|
153
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), C().$reset(),
|
|
155
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), V().$reset(), C().$reset(), Ve().$reset(), Ge().$reset(), k(), h();
|
|
154
156
|
const t = (e = y.value) == null ? void 0 : e.parentElement;
|
|
155
|
-
if (t && (c = new ResizeObserver(h), c.observe(t)),
|
|
157
|
+
if (t && (c = new ResizeObserver(h), c.observe(t)), F(), s.ready)
|
|
156
158
|
await E();
|
|
157
159
|
else {
|
|
158
160
|
const i = H(() => s.ready, (l) => {
|
|
@@ -161,13 +163,15 @@ const Ct = /* @__PURE__ */ le({
|
|
|
161
163
|
}
|
|
162
164
|
document.addEventListener("dynamic-content:open", b);
|
|
163
165
|
}), ue(() => {
|
|
164
|
-
if (Ie(), ke(),
|
|
166
|
+
if (Ie(), ke(), n.dispose(), c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b), S(f)) {
|
|
167
|
+
Re(), Te();
|
|
165
168
|
try {
|
|
166
169
|
C().isStripoInitialized = !1;
|
|
167
170
|
} catch (t) {
|
|
168
171
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
169
172
|
}
|
|
170
|
-
|
|
173
|
+
}
|
|
174
|
+
M(async () => {
|
|
171
175
|
if (S(f))
|
|
172
176
|
try {
|
|
173
177
|
window.UIEditor.removeEditor();
|
|
@@ -182,10 +186,10 @@ const Ct = /* @__PURE__ */ le({
|
|
|
182
186
|
},
|
|
183
187
|
hasChanges: u,
|
|
184
188
|
saveSilent: I,
|
|
185
|
-
setLoading:
|
|
186
|
-
}), { __sfc: !0, openMetrics:
|
|
189
|
+
setLoading: R
|
|
190
|
+
}), { __sfc: !0, openMetrics: n, PreviewContainer: K, OnboardingWrapper: j, AssignStrategyDrawer: J, RemoveStrategyModal: Q, DisplayConditionsHost: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: D, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, props: s, configStore: o, editorStore: m, previewStore: Z, hasChanges: u, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: k, saveSilent: I, setLoading: R, emit: a, buildMetadata: v, initPlugin: T, preloadRuntime: F, runExclusive: M, beginMount: L, isCurrentMount: S, mountGeneration: f, getDefaultTemplate: U, cloneTimersOnSave: N, hasTimerBlocks: _, noHeader: oe, isRrsEnabled: re, isExternalDisplayConditionsEnabled: ne, hasAssignedStrategy: ae, insertDynamicContent: x, closeDynamicContent: A, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: h, startEditor: E, AutoSaveController: Fe, AuthErrorModal: Me, Toaster: Le, FilterSelectionDrawer: Ue, HeaderWrapper: Ne, LoadingWrapper: _e, SaveAsTemplateDrawer: xe, UnsubscribeWrapper: Ae, ValidationErrorDrawer: Be };
|
|
187
191
|
}
|
|
188
192
|
});
|
|
189
193
|
export {
|
|
190
|
-
|
|
194
|
+
It as default
|
|
191
195
|
};
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "./CodeEditorField.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
5
|
var e = this, r = e._self._c, o = e._self._setupProxy;
|
|
6
|
-
return r("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [r("p", { staticClass: "guido-code-editor-field__label" }, [e._v(" " + e._s(e.label) + " ")]), r(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:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
i,
|
|
6
|
+
return r("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [r("p", { staticClass: "guido-code-editor-field__label" }, [e._v(" " + e._s(e.label) + " ")]), r(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);
|
|
7
|
+
}, a = [], d = /* @__PURE__ */ i(
|
|
8
|
+
t,
|
|
9
|
+
s,
|
|
11
10
|
a,
|
|
12
|
-
n,
|
|
13
11
|
!1,
|
|
14
12
|
null,
|
|
15
|
-
"
|
|
13
|
+
"c262cac4"
|
|
16
14
|
);
|
|
17
15
|
const p = d.exports;
|
|
18
16
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InCodeSnippet as
|
|
3
|
-
const
|
|
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
4
|
__name: "CodeEditorField",
|
|
5
5
|
props: {
|
|
6
6
|
id: null,
|
|
@@ -11,20 +11,31 @@ const m = /* @__PURE__ */ s({
|
|
|
11
11
|
disabled: { type: Boolean, default: !1 }
|
|
12
12
|
},
|
|
13
13
|
emits: ["input"],
|
|
14
|
-
setup(
|
|
15
|
-
const l =
|
|
16
|
-
let e = null;
|
|
17
|
-
const
|
|
14
|
+
setup(r, { expose: a, emit: n }) {
|
|
15
|
+
const l = r, u = 700;
|
|
16
|
+
let t = null, e = null;
|
|
17
|
+
const d = m(() => ({
|
|
18
18
|
mode: "liquid",
|
|
19
19
|
lint: !1,
|
|
20
20
|
foldGutter: !1,
|
|
21
21
|
placeholder: l.placeholder
|
|
22
|
-
})),
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
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 };
|
|
26
37
|
}
|
|
27
38
|
});
|
|
28
39
|
export {
|
|
29
|
-
|
|
40
|
+
S as default
|
|
30
41
|
};
|
|
@@ -1,71 +1,81 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useDisplayConditions as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const J = /* @__PURE__ */ D({
|
|
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({
|
|
11
10
|
__name: "DisplayConditionCreateDrawer",
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
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)
|
|
16
23
|
return;
|
|
17
|
-
const { editing: t } =
|
|
24
|
+
const { editing: t } = p;
|
|
18
25
|
Object.assign(e, t ? {
|
|
19
26
|
name: t.name,
|
|
20
27
|
description: t.description,
|
|
21
28
|
codeBefore: t.beforeScript,
|
|
22
29
|
codeAfter: t.afterScript
|
|
23
|
-
} :
|
|
30
|
+
} : m()), o.value = {}, r.value = !1;
|
|
24
31
|
}, { immediate: !0 });
|
|
25
|
-
const
|
|
26
|
-
academyLink: `<a href="${x.EMAIL_DISPLAY_CONDITIONS}" class="guido-display-condition-academy" target="_blank">${i(`${r}.academy`)}</a>`
|
|
27
|
-
})), S = u(() => ({
|
|
32
|
+
const C = u(() => B("create-description")), D = u(() => ({
|
|
28
33
|
cancelOrBackButton: {
|
|
29
34
|
styling: "ghost",
|
|
30
35
|
type: "secondary",
|
|
31
|
-
labelText:
|
|
32
|
-
disabledStatus:
|
|
36
|
+
labelText: n(`${i}.cancel`),
|
|
37
|
+
disabledStatus: s.value
|
|
33
38
|
},
|
|
34
39
|
secondaryButton: {
|
|
35
40
|
styling: "solid",
|
|
36
41
|
type: "subtle-primary",
|
|
37
|
-
labelText:
|
|
38
|
-
loadingStatus:
|
|
42
|
+
labelText: n(`${i}.create-and-save`),
|
|
43
|
+
loadingStatus: r.value
|
|
39
44
|
},
|
|
40
45
|
primaryButton: {
|
|
41
46
|
styling: "solid",
|
|
42
47
|
type: "primary",
|
|
43
|
-
labelText:
|
|
44
|
-
disabledStatus:
|
|
48
|
+
labelText: n(`${i}.create`),
|
|
49
|
+
disabledStatus: s.value
|
|
45
50
|
}
|
|
46
|
-
})),
|
|
47
|
-
t !== e[
|
|
48
|
-
},
|
|
49
|
-
return { __sfc: !0,
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
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">(${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)
|
|
52
57
|
return;
|
|
53
|
-
|
|
54
|
-
|
|
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();
|
|
55
65
|
return;
|
|
56
66
|
}
|
|
57
|
-
if (
|
|
58
|
-
|
|
67
|
+
if (a === "inline") {
|
|
68
|
+
y({ ...e });
|
|
59
69
|
return;
|
|
60
70
|
}
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
71
|
+
r.value = !0;
|
|
72
|
+
const h = await _({ ...e });
|
|
73
|
+
r.value = !1, o.value = h ?? {}, Object.keys(o.value).length && f();
|
|
64
74
|
}, close: () => {
|
|
65
|
-
|
|
66
|
-
}, WpDrawer:
|
|
75
|
+
s.value || b();
|
|
76
|
+
}, WpDrawer: R, KEY: i, DISPLAY_CONDITION_LIMITS: j, InBasicTextInput: F, InRadioButton: P, CodeEditorField: G };
|
|
67
77
|
}
|
|
68
78
|
});
|
|
69
79
|
export {
|
|
70
|
-
|
|
80
|
+
Z as default
|
|
71
81
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import a from "./DisplayConditionSelectDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
5
|
var s = this, i = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return i("div", { staticClass: "guido-display-condition-select-root" }, [i(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 } }, [i("div", { staticClass: "guido-display-condition-select" }, [t.store.listStatus === "loaded" && t.store.list.length ? i(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(e) {
|
|
6
|
+
return i("div", { staticClass: "guido-display-condition-select-root" }, [i(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 } }, [i("div", { staticClass: "guido-display-condition-select d-f f-d-c f-g-1" }, [t.store.listStatus === "loaded" && t.store.list.length ? i(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(e) {
|
|
7
7
|
t.search = e;
|
|
8
8
|
} } }) : s._e(), t.store.listStatus === "loading" || t.store.listStatus === "idle" ? i("div", { staticClass: "guido-display-condition-select__list", attrs: { "data-testid": "display-condition-loading" } }, s._l(t.SKELETON_HEIGHTS, function(e, n) {
|
|
9
9
|
return i(t.InSkeleton, { key: n, attrs: { sizing: { width: 856, height: e } } });
|
|
10
|
-
}), 1) : t.store.listStatus === "error" ? i(t.InNoData, { attrs: { id: "guido__display-condition-error", "button-status": "", icon: "no-data", "button-text": t.trans(`${t.KEY}.retry`), description: t.trans(`${t.KEY}.error-load`), title: t.trans(`${t.KEY}.error-load-title`) }, on: { click: t.loadList } }) : t.store.list.length ? t.filteredList.length ? i("ul", { staticClass: "guido-display-condition-select__list" }, s._l(t.filteredList, function(e) {
|
|
10
|
+
}), 1) : t.store.listStatus === "error" ? i(t.InNoData, { staticClass: "d-f f-d-c j-c-c f-g-1", attrs: { id: "guido__display-condition-error", "button-status": "", icon: "no-data", "button-text": t.trans(`${t.KEY}.retry`), description: t.trans(`${t.KEY}.error-load`), title: t.trans(`${t.KEY}.error-load-title`) }, on: { click: t.loadList } }) : t.store.list.length ? t.filteredList.length ? i("ul", { staticClass: "guido-display-condition-select__list" }, s._l(t.filteredList, function(e) {
|
|
11
11
|
return i("li", { key: e.id, staticClass: "guido-display-condition-card", attrs: { "data-condition-id": e.id } }, [i("div", { staticClass: "guido-display-condition-card__header" }, [i("div", { staticClass: "guido-display-condition-card__text" }, [i("p", { staticClass: "guido-display-condition-card__name" }, [s._v(" " + s._s(e.name) + " ")]), e.description ? i("p", { staticClass: "guido-display-condition-card__description" }, [s._v(" " + s._s(e.description) + " ")]) : s._e()]), i("div", { staticClass: "guido-display-condition-card__actions" }, [i("div", { staticClass: "guido-display-condition-card__split" }, [i(t.InButtonV2, { attrs: { id: `guido__display-condition-select-${e.id}`, type: "subtle-primary", "label-text": t.trans(`${t.KEY}.select`) }, on: { click: function(n) {
|
|
12
12
|
return t.select(e);
|
|
13
13
|
} } }), i(t.InButtonV2, { attrs: { id: `guido__display-condition-menu-${e.id}`, "left-icon": "filled-dropdown-down", type: "subtle-primary", "label-text-status": !1 }, on: { click: function(n) {
|
|
@@ -17,18 +17,18 @@ var d = function() {
|
|
|
17
17
|
} } }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete`)) + " ")])]) : s._e()], 1), i("span", { staticClass: "guido-display-condition-card__divider" }), i("button", { staticClass: "guido-display-condition-card__expand", attrs: { id: `guido__display-condition-expand-${e.id}`, type: "button", "aria-expanded": t.expandedId === e.id ? "true" : "false", "aria-label": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
|
|
18
18
|
return t.toggleExpanded(e);
|
|
19
19
|
} } }, [i(t.InIcons, { attrs: { name: t.expandedId === e.id ? "filled-dropdown-up" : "filled-dropdown-down" } })], 1)])]), t.expandedId === e.id ? i("pre", { staticClass: "guido-display-condition-card__code" }, [s._v(s._s(t.codeOf(e)))]) : s._e()]);
|
|
20
|
-
}), 0) : i(t.InNoData, { attrs: { id: "guido__display-condition-no-result", icon: "no-data", title: t.trans(`${t.KEY}.no-result`) } }) : i(t.InNoData, { attrs: { id: "guido__display-condition-empty", "button-status": "", icon: "no-personalization", "button-text": t.trans(`${t.KEY}.create-new`), description: t.trans(`${t.KEY}.empty-description`), title: t.trans(`${t.KEY}.empty-title`) }, on: { click: function(e) {
|
|
20
|
+
}), 0) : i(t.InNoData, { staticClass: "d-f f-d-c j-c-c f-g-1", attrs: { id: "guido__display-condition-no-result", icon: "no-data", title: t.trans(`${t.KEY}.no-result`) } }) : i(t.InNoData, { staticClass: "d-f f-d-c j-c-c f-g-1", attrs: { id: "guido__display-condition-empty", "button-status": "", icon: "no-personalization", "button-text": t.trans(`${t.KEY}.create-new`), description: t.trans(`${t.KEY}.empty-description`), title: t.trans(`${t.KEY}.empty-title`) }, on: { click: function(e) {
|
|
21
21
|
return t.store.openCreate();
|
|
22
22
|
} } })], 1)]), t.store.pendingDelete ? i("div", { staticClass: "guido-display-condition-select__delete-modal" }, [i(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 } }, [i("p", { staticClass: "guido-display-condition-select__delete-text" }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete-confirm-description`, { name: t.store.pendingDelete.name })) + " ")])])], 1) : s._e()], 1);
|
|
23
|
-
}, l = [], c = /* @__PURE__ */
|
|
23
|
+
}, l = [], c = /* @__PURE__ */ d(
|
|
24
24
|
a,
|
|
25
|
-
|
|
25
|
+
o,
|
|
26
26
|
l,
|
|
27
27
|
!1,
|
|
28
28
|
null,
|
|
29
|
-
"
|
|
29
|
+
"21acc8d8"
|
|
30
30
|
);
|
|
31
|
-
const
|
|
31
|
+
const f = c.exports;
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
f as default
|
|
34
34
|
};
|
|
@@ -1,57 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useDisplayConditions as
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const J = /* @__PURE__ */ _({
|
|
1
|
+
import { defineComponent as x, ref as a, watch as D, computed as r, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import b from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import h from "../../wrappers/WpModal.vue.js";
|
|
4
|
+
import { useDisplayConditions as C, DISPLAY_CONDITIONS_TRANS_KEY as c } from "../../../composables/useDisplayConditions.js";
|
|
5
|
+
import { useTranslations as w } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { useDisplayConditionStore as k } from "../../../stores/display-condition.js";
|
|
7
|
+
import { InSkeleton as A, InNoData as N, InIcons as $, InButtonV2 as K, InBasicTextInput as P } from "@useinsider/design-system-vue";
|
|
8
|
+
const Q = /* @__PURE__ */ x({
|
|
10
9
|
__name: "DisplayConditionSelectDrawer",
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
e && (
|
|
10
|
+
setup(W) {
|
|
11
|
+
const I = [40, 76, 76, 76], l = w(), t = k(), { loadList: m, select: y, deleteSaved: f, cancel: _, describeWithAcademyLink: v } = C(), u = a(""), i = a(null), n = a(null), o = a(!1);
|
|
12
|
+
D(() => t.isSelectOpen, (e) => {
|
|
13
|
+
e && (u.value = "", i.value = null, n.value = null, m());
|
|
15
14
|
}, { immediate: !0 });
|
|
16
|
-
const
|
|
17
|
-
const e =
|
|
18
|
-
return e ? t.list.filter((
|
|
19
|
-
}),
|
|
20
|
-
academyLink: `<a href="${T.EMAIL_DISPLAY_CONDITIONS}" class="guido-display-condition-academy" target="_blank">${l(`${o}.academy`)}</a>`
|
|
21
|
-
})), y = c(() => ({
|
|
15
|
+
const O = r(() => {
|
|
16
|
+
const e = u.value.trim().toLocaleLowerCase();
|
|
17
|
+
return e ? t.list.filter((d) => `${d.name} ${d.description}`.toLocaleLowerCase().includes(e)) : t.list;
|
|
18
|
+
}), S = r(() => v("select-description")), B = r(() => ({
|
|
22
19
|
cancelOrBackButton: {
|
|
23
20
|
styling: "ghost",
|
|
24
21
|
type: "secondary",
|
|
25
|
-
labelText: l(`${
|
|
22
|
+
labelText: l(`${c}.back`),
|
|
26
23
|
leftIcon: "line-arrow-left"
|
|
27
24
|
}
|
|
28
|
-
})),
|
|
25
|
+
})), L = r(() => ({
|
|
29
26
|
cancelOrBackButton: {
|
|
30
27
|
type: "secondary",
|
|
31
28
|
styling: "ghost",
|
|
32
|
-
labelText: l(`${
|
|
33
|
-
disabledStatus:
|
|
29
|
+
labelText: l(`${c}.cancel`),
|
|
30
|
+
disabledStatus: o.value
|
|
34
31
|
},
|
|
35
32
|
primaryButton: {
|
|
36
33
|
type: "danger",
|
|
37
|
-
labelText: l(`${
|
|
38
|
-
loadingStatus:
|
|
34
|
+
labelText: l(`${c}.delete`),
|
|
35
|
+
loadingStatus: o.value
|
|
39
36
|
}
|
|
40
|
-
}))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
})), E = (e) => {
|
|
38
|
+
i.value = i.value === e.id ? null : e.id;
|
|
39
|
+
}, T = (e) => {
|
|
40
|
+
n.value = n.value === e.id ? null : e.id;
|
|
41
|
+
}, s = (e) => {
|
|
42
|
+
e.composedPath().some((p) => {
|
|
43
|
+
var g;
|
|
44
|
+
return p instanceof Element && p.matches(".guido-display-condition-card__split") && ((g = p.closest(".guido-display-condition-card")) == null ? void 0 : g.getAttribute("data-condition-id")) === String(n.value);
|
|
45
|
+
}) || (n.value = null);
|
|
46
|
+
};
|
|
47
|
+
return D(n, (e) => {
|
|
48
|
+
e === null ? document.removeEventListener("pointerdown", s, !0) : document.addEventListener("pointerdown", s, !0);
|
|
49
|
+
}), M(() => {
|
|
50
|
+
document.removeEventListener("pointerdown", s, !0);
|
|
51
|
+
}), { __sfc: !0, SKELETON_HEIGHTS: I, trans: l, store: t, loadList: m, select: y, deleteSaved: f, cancel: _, describeWithAcademyLink: v, search: u, expandedId: i, menuId: n, isDeleting: o, filteredList: O, descriptionText: S, footerButtonGroupOptions: B, deleteModalButtons: L, toggleExpanded: E, toggleMenu: T, closeMenuOnOutsidePointer: s, requestDelete: (e) => {
|
|
52
|
+
n.value = null, t.pendingDelete = e;
|
|
47
53
|
}, confirmDelete: async () => {
|
|
48
|
-
!t.pendingDelete ||
|
|
54
|
+
!t.pendingDelete || o.value || (o.value = !0, await f(t.pendingDelete), o.value = !1);
|
|
49
55
|
}, closeDeleteModal: () => {
|
|
50
|
-
|
|
56
|
+
o.value || (t.pendingDelete = null);
|
|
51
57
|
}, codeOf: (e) => [e.codeBefore, e.codeAfter].filter(Boolean).join(`
|
|
52
|
-
`), WpDrawer:
|
|
58
|
+
`), WpDrawer: b, WpModal: h, KEY: c, InBasicTextInput: P, InButtonV2: K, InIcons: $, InNoData: N, InSkeleton: A };
|
|
53
59
|
}
|
|
54
60
|
});
|
|
55
61
|
export {
|
|
56
|
-
|
|
62
|
+
Q as default
|
|
57
63
|
};
|