@useinsider/guido 3.18.1-beta.e39fb14 → 3.18.1-beta.e609a33
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/README.md +0 -1
- package/dist/@types/config/schemas.js +26 -28
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +51 -53
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +34 -41
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +39 -37
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/stores/config.d.ts +0 -30
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +22 -39
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +1 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
package/README.md
CHANGED
|
@@ -162,7 +162,6 @@ const config: GuidoConfigInput = {
|
|
|
162
162
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
163
163
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
164
164
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
165
|
-
allowSaveWithErrors?: boolean, // Default: true - Allow the validation drawer's "Save and Continue" soft-save. Set false to hard-block invalid saves (transactional + unsubscribe pages).
|
|
166
165
|
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
167
166
|
},
|
|
168
167
|
|
|
@@ -30,7 +30,7 @@ const p = {
|
|
|
30
30
|
name: t(),
|
|
31
31
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
32
|
family: t()
|
|
33
|
-
}),
|
|
33
|
+
}), M = a({
|
|
34
34
|
/** Partner/organization name (required) */
|
|
35
35
|
name: m(
|
|
36
36
|
t(),
|
|
@@ -54,7 +54,7 @@ const p = {
|
|
|
54
54
|
username: e(t(), "Guido User"),
|
|
55
55
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
56
|
fallbackFont: e(L)
|
|
57
|
-
}),
|
|
57
|
+
}), E = a({
|
|
58
58
|
/** Display text for the dynamic content */
|
|
59
59
|
text: t(),
|
|
60
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -76,10 +76,10 @@ const p = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})),
|
|
79
|
+
})), N = k(
|
|
80
80
|
t(),
|
|
81
81
|
R(c(S), [])
|
|
82
|
-
),
|
|
82
|
+
), P = g({
|
|
83
83
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
84
84
|
id: e(n()),
|
|
85
85
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
@@ -124,7 +124,7 @@ const p = {
|
|
|
124
124
|
isPriceMovedToNextLine: e(o()),
|
|
125
125
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
126
126
|
isPriceDeletedForZeroSale: e(o())
|
|
127
|
-
}),
|
|
127
|
+
}), v = a({
|
|
128
128
|
/**
|
|
129
129
|
* Legacy recommendation block configs keyed by block ID.
|
|
130
130
|
* Pass this when loading a template authored with the v1
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
k(t(),
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), x = a({
|
|
@@ -142,7 +142,7 @@ const p = {
|
|
|
142
142
|
css: e(t(), ""),
|
|
143
143
|
/** Preselected dynamic content items */
|
|
144
144
|
preselectedDynamicContent: e(
|
|
145
|
-
c(
|
|
145
|
+
c(E),
|
|
146
146
|
[]
|
|
147
147
|
),
|
|
148
148
|
/**
|
|
@@ -151,7 +151,7 @@ const p = {
|
|
|
151
151
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
152
152
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
153
153
|
*/
|
|
154
|
-
dynamicContentList: e(
|
|
154
|
+
dynamicContentList: e(N, {}),
|
|
155
155
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
156
156
|
customFieldAttributes: e(c(t()), []),
|
|
157
157
|
/** Selected unsubscribe page IDs */
|
|
@@ -173,7 +173,7 @@ const p = {
|
|
|
173
173
|
0
|
|
174
174
|
),
|
|
175
175
|
/** Migration-only inputs (legacy block configs) */
|
|
176
|
-
migration: e(
|
|
176
|
+
migration: e(v, {})
|
|
177
177
|
}), D = a({
|
|
178
178
|
/** Sender display name */
|
|
179
179
|
senderName: e(t(), ""),
|
|
@@ -220,10 +220,8 @@ const p = {
|
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
222
|
linkTrackingIds: e(o(), !1),
|
|
223
|
-
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
224
|
-
allowSaveWithErrors: e(o(), !0),
|
|
225
223
|
reusableRecommendationStrategy: e(o(), !1)
|
|
226
|
-
}),
|
|
224
|
+
}), B = i([
|
|
227
225
|
"amp-accordion",
|
|
228
226
|
"amp-carousel",
|
|
229
227
|
"amp-form-controls",
|
|
@@ -237,7 +235,7 @@ const p = {
|
|
|
237
235
|
"text-block",
|
|
238
236
|
"timer-block",
|
|
239
237
|
"video-block"
|
|
240
|
-
]),
|
|
238
|
+
]), w = i([
|
|
241
239
|
"dynamic-content",
|
|
242
240
|
"checkbox-block",
|
|
243
241
|
"radio-button-block",
|
|
@@ -248,12 +246,12 @@ const p = {
|
|
|
248
246
|
]), H = a({
|
|
249
247
|
/** Default blocks to exclude from the editor */
|
|
250
248
|
excludeDefaults: e(
|
|
251
|
-
c(
|
|
249
|
+
c(B),
|
|
252
250
|
[]
|
|
253
251
|
),
|
|
254
252
|
/** Custom blocks to include in the editor */
|
|
255
253
|
includeCustoms: e(
|
|
256
|
-
c(
|
|
254
|
+
c(w),
|
|
257
255
|
[]
|
|
258
256
|
)
|
|
259
257
|
}), d = a({
|
|
@@ -304,7 +302,7 @@ const p = {
|
|
|
304
302
|
customRules: e(c(V), []),
|
|
305
303
|
/** Skip default compiler rules */
|
|
306
304
|
ignoreDefaultRules: e(o(), !1)
|
|
307
|
-
}),
|
|
305
|
+
}), Z = a({
|
|
308
306
|
/**
|
|
309
307
|
* External validation handler called before save completes.
|
|
310
308
|
* Return false to cancel the save operation.
|
|
@@ -315,12 +313,12 @@ const p = {
|
|
|
315
313
|
"externalValidation must be a function"
|
|
316
314
|
)
|
|
317
315
|
)
|
|
318
|
-
}),
|
|
316
|
+
}), Q = a({
|
|
319
317
|
// Required sections
|
|
320
318
|
/** Identity configuration (required) */
|
|
321
319
|
identity: A,
|
|
322
320
|
/** Partner configuration (required) */
|
|
323
|
-
partner:
|
|
321
|
+
partner: M,
|
|
324
322
|
// Optional sections (with defaults)
|
|
325
323
|
/** Template content and presets */
|
|
326
324
|
template: e(x, {}),
|
|
@@ -335,33 +333,33 @@ const p = {
|
|
|
335
333
|
/** Compiler configuration */
|
|
336
334
|
compiler: e(z, {}),
|
|
337
335
|
/** Callbacks and event handlers */
|
|
338
|
-
callbacks: e(
|
|
336
|
+
callbacks: e(Z, {})
|
|
339
337
|
});
|
|
340
338
|
export {
|
|
341
339
|
H as BlocksSchema,
|
|
342
|
-
|
|
340
|
+
Z as CallbacksSchema,
|
|
343
341
|
V as CompilerRuleSchema,
|
|
344
342
|
z as CompilerSchema,
|
|
345
|
-
|
|
343
|
+
w as CustomBlockTypeSchema,
|
|
346
344
|
G as CustomRuleSchema,
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
B as DefaultBlockTypeSchema,
|
|
346
|
+
N as DynamicContentListSchema,
|
|
349
347
|
S as DynamicContentNodeSchema,
|
|
350
|
-
|
|
348
|
+
E as DynamicContentSchema,
|
|
351
349
|
O as EditorSchema,
|
|
352
350
|
D as EmailHeaderSchema,
|
|
353
351
|
L as FallbackFontSchema,
|
|
354
352
|
U as FeaturesSchema,
|
|
355
|
-
|
|
353
|
+
Q as GuidoConfigSchema,
|
|
356
354
|
A as IdentitySchema,
|
|
357
|
-
|
|
355
|
+
P as LegacyRecommendationConfigSchema,
|
|
358
356
|
p as MessageType,
|
|
359
|
-
|
|
357
|
+
M as PartnerSchema,
|
|
360
358
|
l as ProductType,
|
|
361
359
|
j as RegexRuleSchema,
|
|
362
360
|
q as RemoveRuleSchema,
|
|
363
361
|
_ as ReplaceRuleSchema,
|
|
364
|
-
|
|
362
|
+
v as TemplateMigrationSchema,
|
|
365
363
|
x as TemplateSchema,
|
|
366
364
|
F as UISchema
|
|
367
365
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, s = [], n = /* @__PURE__ */
|
|
10
|
-
|
|
9
|
+
}, s = [], n = /* @__PURE__ */ i(
|
|
10
|
+
o,
|
|
11
11
|
t,
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"050dfa52"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const f = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as default
|
|
20
20
|
};
|
|
@@ -1,57 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { provideGuidoActions as
|
|
5
|
-
import { useGuidoStateBridge as
|
|
6
|
-
import { usePartner as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useTimerClone as fe } from "../composables/useTimerClone.js";
|
|
1
|
+
import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as P, onMounted as re, onUnmounted as se } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as ie } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as me } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as le } from "../composables/useStripo.js";
|
|
8
|
+
import { useTimerClone as ue } from "../composables/useTimerClone.js";
|
|
10
9
|
import { migrate as x } from "../config/migrator/index.js";
|
|
11
10
|
import { ModuleFolderDefaults as W } from "../enums/defaults.js";
|
|
12
|
-
import { RIBBON_SELECTOR as
|
|
11
|
+
import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
|
|
13
12
|
import { useRecommendationExtensionStore as G } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { useDynamicContentStore as Te } from "../stores/dynamic-content.js";
|
|
13
|
+
import fe from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import ye from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import ve from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import Se from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import he from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as Ee } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as we } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
|
|
25
23
|
import { useEditorStore as H } from "../stores/editor.js";
|
|
26
|
-
import { usePreviewStore as
|
|
27
|
-
import { useTemplateStore as
|
|
28
|
-
import { useUnsubscribeStore as
|
|
29
|
-
import { readTrackFloor as
|
|
30
|
-
const
|
|
24
|
+
import { usePreviewStore as De } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as ke } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
|
|
27
|
+
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const et = /* @__PURE__ */ ne({
|
|
31
29
|
__name: "Guido",
|
|
32
30
|
props: {
|
|
33
31
|
config: null,
|
|
34
32
|
ready: { type: Boolean, default: !0 }
|
|
35
33
|
},
|
|
36
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
37
|
-
setup(
|
|
38
|
-
const a =
|
|
35
|
+
setup(z, { expose: q, emit: r }) {
|
|
36
|
+
const a = z, K = l(
|
|
39
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
40
|
-
),
|
|
38
|
+
), V = l(
|
|
41
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
42
40
|
), j = l(
|
|
43
41
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
44
42
|
), J = l(
|
|
45
43
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
46
|
-
), h = O(), p = O(), f =
|
|
44
|
+
), h = O(), p = O(), f = Ce(), E = Te(), o = we();
|
|
47
45
|
a.ready && o.init(a.config);
|
|
48
|
-
const c = H(), Q =
|
|
46
|
+
const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
|
|
49
47
|
var t;
|
|
50
48
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
51
49
|
}, C = (t) => {
|
|
52
50
|
c.loadingStatus = t;
|
|
53
51
|
};
|
|
54
|
-
|
|
52
|
+
ae(), de();
|
|
55
53
|
const y = () => {
|
|
56
54
|
var t, e;
|
|
57
55
|
return {
|
|
@@ -62,15 +60,15 @@ const st = /* @__PURE__ */ re({
|
|
|
62
60
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
|
|
63
61
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
|
|
64
62
|
};
|
|
65
|
-
}, { initPlugin: D, preloadRuntime: k } =
|
|
66
|
-
let
|
|
67
|
-
const { getDefaultTemplate:
|
|
63
|
+
}, { initPlugin: D, preloadRuntime: k } = le(), { runExclusive: T, beginMount: F, isCurrentMount: I } = ie();
|
|
64
|
+
let g = 0;
|
|
65
|
+
const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: R, hasTimerBlocks: L } = ue(), Y = u(() => {
|
|
68
66
|
var t;
|
|
69
67
|
return !((t = o.ui) != null && t.showHeader);
|
|
70
|
-
}),
|
|
68
|
+
}), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
|
|
71
69
|
() => !!G().recommendationConfigs.strategyId
|
|
72
70
|
);
|
|
73
|
-
|
|
71
|
+
ce({
|
|
74
72
|
onBack: () => {
|
|
75
73
|
console.debug("guido:back"), r("back");
|
|
76
74
|
},
|
|
@@ -93,14 +91,14 @@ const st = /* @__PURE__ */ re({
|
|
|
93
91
|
P(() => m.value, () => {
|
|
94
92
|
r("on-change", m.value);
|
|
95
93
|
});
|
|
96
|
-
const
|
|
94
|
+
const v = (t) => {
|
|
97
95
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
98
96
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
99
97
|
};
|
|
100
98
|
let i = null;
|
|
101
99
|
const S = () => {
|
|
102
100
|
var e;
|
|
103
|
-
const t = document.querySelector(
|
|
101
|
+
const t = document.querySelector(pe);
|
|
104
102
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
105
103
|
}, b = async () => {
|
|
106
104
|
var t;
|
|
@@ -113,23 +111,23 @@ const st = /* @__PURE__ */ re({
|
|
|
113
111
|
html: s && await x(s, _),
|
|
114
112
|
css: d
|
|
115
113
|
};
|
|
116
|
-
n.html || (n = await
|
|
117
|
-
const
|
|
118
|
-
L(n.html) && (n.html = await
|
|
119
|
-
const
|
|
114
|
+
n.html || (n = await M(), n.html = await x(n.html, _));
|
|
115
|
+
const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
116
|
+
L(n.html) && (n.html = await R(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
|
|
117
|
+
const oe = {
|
|
120
118
|
preselectedDynamicContentList: U,
|
|
121
119
|
onReady: () => {
|
|
122
120
|
console.debug("guido:ready"), r("ready");
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
|
-
|
|
123
|
+
g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
|
|
126
124
|
} catch (e) {
|
|
127
125
|
console.error("Failed to initialize Stripo editor:", e);
|
|
128
126
|
}
|
|
129
127
|
};
|
|
130
|
-
return
|
|
128
|
+
return re(async () => {
|
|
131
129
|
var e;
|
|
132
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(),
|
|
130
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
|
|
133
131
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
134
132
|
if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
|
|
135
133
|
await b();
|
|
@@ -138,17 +136,17 @@ const st = /* @__PURE__ */ re({
|
|
|
138
136
|
d && (s(), b());
|
|
139
137
|
});
|
|
140
138
|
}
|
|
141
|
-
document.addEventListener("dynamic-content:open",
|
|
142
|
-
}),
|
|
143
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
144
|
-
if (
|
|
139
|
+
document.addEventListener("dynamic-content:open", v);
|
|
140
|
+
}), se(() => {
|
|
141
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), T(async () => {
|
|
142
|
+
if (I(g))
|
|
145
143
|
try {
|
|
146
144
|
window.UIEditor.removeEditor();
|
|
147
145
|
} catch {
|
|
148
146
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
149
147
|
}
|
|
150
148
|
}), o.reset();
|
|
151
|
-
}),
|
|
149
|
+
}), q({
|
|
152
150
|
dynamicContent: {
|
|
153
151
|
insert: B,
|
|
154
152
|
close: A
|
|
@@ -156,9 +154,9 @@ const st = /* @__PURE__ */ re({
|
|
|
156
154
|
hasChanges: m,
|
|
157
155
|
saveSilent: w,
|
|
158
156
|
setLoading: C
|
|
159
|
-
}), { __sfc: !0, PreviewContainer:
|
|
157
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: R, hasTimerBlocks: L, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: B, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
|
|
160
158
|
}
|
|
161
159
|
});
|
|
162
160
|
export {
|
|
163
|
-
|
|
161
|
+
et as default
|
|
164
162
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useAutoSave as
|
|
3
|
-
import { useSave as
|
|
4
|
-
|
|
5
|
-
const v = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useAutoSave as r } from "../../composables/useAutoSave.js";
|
|
3
|
+
import { useSave as s } from "../../composables/useSave.js";
|
|
4
|
+
const f = /* @__PURE__ */ t({
|
|
6
5
|
__name: "AutoSaveController",
|
|
7
|
-
setup(
|
|
8
|
-
const { save: e
|
|
9
|
-
return
|
|
6
|
+
setup(a) {
|
|
7
|
+
const { save: e } = s(), o = () => e(!1, !0);
|
|
8
|
+
return r(o), { __sfc: !0, save: e, backgroundSave: o };
|
|
10
9
|
}
|
|
11
10
|
});
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
f as default
|
|
14
13
|
};
|
|
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
4
4
|
var u = function() {
|
|
5
5
|
var s, i, n, a;
|
|
6
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, "
|
|
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", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
|
|
8
8
|
return t.handleSave(!1);
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
@@ -15,7 +15,7 @@ var u = function() {
|
|
|
15
15
|
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"1ca6baf0"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,109 +1,79 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useExport as
|
|
5
|
-
import { useTestEmailClick as
|
|
6
|
-
import { useHtmlCompiler as
|
|
7
|
-
import { useSave as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
import { getTooltipOptions as ot } from "../../../utils/tooltipUtils.js";
|
|
20
|
-
import { InButtonV2 as rt } from "@useinsider/design-system-vue";
|
|
21
|
-
import { storeToRefs as it } from "pinia";
|
|
22
|
-
import at from "./MigrationConfirmModal.vue.js";
|
|
23
|
-
const Ot = /* @__PURE__ */ D({
|
|
1
|
+
import { defineComponent as q, ref as l, computed as w } from "vue";
|
|
2
|
+
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as B } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as R } from "../../../composables/useSave.js";
|
|
8
|
+
import { useToaster as z } from "../../../composables/useToaster.js";
|
|
9
|
+
import { useTranslations as I } from "../../../composables/useTranslations.js";
|
|
10
|
+
import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
|
|
11
|
+
import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
|
|
12
|
+
import { useEditorStore as G } from "../../../stores/editor.js";
|
|
13
|
+
import { useTemplateStore as J } from "../../../stores/template.js";
|
|
14
|
+
import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
|
|
15
|
+
import { InButtonV2 as N } from "@useinsider/design-system-vue";
|
|
16
|
+
import { storeToRefs as Q } from "pinia";
|
|
17
|
+
import U from "./MigrationConfirmModal.vue.js";
|
|
18
|
+
const ft = /* @__PURE__ */ q({
|
|
24
19
|
__name: "EditorActions",
|
|
25
|
-
setup(
|
|
26
|
-
const { config:
|
|
27
|
-
if (
|
|
28
|
-
|
|
20
|
+
setup(W, { expose: x }) {
|
|
21
|
+
const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
|
|
22
|
+
if (e.isVersionHistoryOpen) {
|
|
23
|
+
d();
|
|
29
24
|
return;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
26
|
+
f();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
i.value = !0, await p(), i.value = !1;
|
|
29
|
+
}, A = () => {
|
|
30
|
+
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
+
}, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
|
|
37
32
|
() => {
|
|
38
|
-
var t,
|
|
39
|
-
return ((
|
|
33
|
+
var t, o;
|
|
34
|
+
return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
40
35
|
}
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
let
|
|
36
|
+
), E = async (t) => {
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
|
+
let o;
|
|
44
39
|
try {
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
40
|
+
o = await u(t);
|
|
41
|
+
} catch (n) {
|
|
47
42
|
if (t)
|
|
48
|
-
throw
|
|
49
|
-
|
|
43
|
+
throw n;
|
|
44
|
+
r(n, "Failed to save template");
|
|
50
45
|
} finally {
|
|
51
|
-
|
|
46
|
+
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
52
47
|
}
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
var
|
|
56
|
-
if (!t &&
|
|
57
|
-
(
|
|
48
|
+
return o;
|
|
49
|
+
}, T = (t) => {
|
|
50
|
+
var o;
|
|
51
|
+
if (!t && H.value) {
|
|
52
|
+
(o = S.value) == null || o.open();
|
|
58
53
|
return;
|
|
59
54
|
}
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
let t = [];
|
|
65
|
-
try {
|
|
66
|
-
t = await y();
|
|
67
|
-
} catch (e) {
|
|
68
|
-
console.warn("Test-path validation failed; sending without the drawer.", e);
|
|
69
|
-
} finally {
|
|
70
|
-
o.loadingStatus = !1;
|
|
71
|
-
}
|
|
72
|
-
if (t.length) {
|
|
73
|
-
S({
|
|
74
|
-
type: Y.Error,
|
|
75
|
-
message: r("email-editor.validation-errors-found"),
|
|
76
|
-
actionButton: {
|
|
77
|
-
text: r("email-editor.check-errors"),
|
|
78
|
-
onClick: () => H.open(t, "test")
|
|
79
|
-
},
|
|
80
|
-
autoHide: !1
|
|
81
|
-
});
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
l();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (f("liquidSyntax")) {
|
|
88
|
-
o.loadingStatus = !0;
|
|
55
|
+
return E(t);
|
|
56
|
+
}, F = async () => {
|
|
57
|
+
if (c("liquidSyntax")) {
|
|
58
|
+
e.loadingStatus = !0;
|
|
89
59
|
try {
|
|
90
|
-
const { html: t } = await
|
|
91
|
-
if (!await
|
|
60
|
+
const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
|
|
61
|
+
if (!await g(o))
|
|
92
62
|
return;
|
|
93
63
|
} catch (t) {
|
|
94
|
-
|
|
64
|
+
r(t, "Failed to prepare test email");
|
|
95
65
|
return;
|
|
96
66
|
} finally {
|
|
97
|
-
|
|
67
|
+
e.loadingStatus = !1;
|
|
98
68
|
}
|
|
99
69
|
}
|
|
100
|
-
|
|
70
|
+
V();
|
|
101
71
|
};
|
|
102
|
-
return
|
|
103
|
-
handleSave:
|
|
104
|
-
}), { __sfc: !0, config:
|
|
72
|
+
return x({
|
|
73
|
+
handleSave: T
|
|
74
|
+
}), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
105
75
|
}
|
|
106
76
|
});
|
|
107
77
|
export {
|
|
108
|
-
|
|
78
|
+
ft as default
|
|
109
79
|
};
|