@useinsider/guido 3.17.0-beta.ea65303 → 3.17.0-beta.ec8eabb
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 +27 -29
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +59 -60
- 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 +51 -74
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useEditorLock.js +18 -0
- package/dist/composables/useGuidoStateBridge.js +31 -30
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +47 -86
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +26 -33
- package/dist/guido.css +1 -1
- 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/useEditorLock.d.ts +11 -0
- 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
|
},
|
|
167
166
|
|
|
168
167
|
// Optional: Callbacks
|
|
@@ -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 = y(
|
|
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
|
-
y(t(),
|
|
135
|
+
y(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(), ""),
|
|
@@ -219,10 +219,8 @@ const p = {
|
|
|
219
219
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
223
|
-
|
|
224
|
-
allowSaveWithErrors: e(o(), !0)
|
|
225
|
-
}), w = i([
|
|
222
|
+
linkTrackingIds: e(o(), !1)
|
|
223
|
+
}), B = i([
|
|
226
224
|
"amp-accordion",
|
|
227
225
|
"amp-carousel",
|
|
228
226
|
"amp-form-controls",
|
|
@@ -236,7 +234,7 @@ const p = {
|
|
|
236
234
|
"text-block",
|
|
237
235
|
"timer-block",
|
|
238
236
|
"video-block"
|
|
239
|
-
]),
|
|
237
|
+
]), w = i([
|
|
240
238
|
"dynamic-content",
|
|
241
239
|
"checkbox-block",
|
|
242
240
|
"radio-button-block",
|
|
@@ -247,12 +245,12 @@ const p = {
|
|
|
247
245
|
]), H = a({
|
|
248
246
|
/** Default blocks to exclude from the editor */
|
|
249
247
|
excludeDefaults: e(
|
|
250
|
-
c(
|
|
248
|
+
c(B),
|
|
251
249
|
[]
|
|
252
250
|
),
|
|
253
251
|
/** Custom blocks to include in the editor */
|
|
254
252
|
includeCustoms: e(
|
|
255
|
-
c(
|
|
253
|
+
c(w),
|
|
256
254
|
[]
|
|
257
255
|
)
|
|
258
256
|
}), d = a({
|
|
@@ -303,7 +301,7 @@ const p = {
|
|
|
303
301
|
customRules: e(c(V), []),
|
|
304
302
|
/** Skip default compiler rules */
|
|
305
303
|
ignoreDefaultRules: e(o(), !1)
|
|
306
|
-
}),
|
|
304
|
+
}), Z = a({
|
|
307
305
|
/**
|
|
308
306
|
* External validation handler called before save completes.
|
|
309
307
|
* Return false to cancel the save operation.
|
|
@@ -314,12 +312,12 @@ const p = {
|
|
|
314
312
|
"externalValidation must be a function"
|
|
315
313
|
)
|
|
316
314
|
)
|
|
317
|
-
}),
|
|
315
|
+
}), Q = a({
|
|
318
316
|
// Required sections
|
|
319
317
|
/** Identity configuration (required) */
|
|
320
318
|
identity: A,
|
|
321
319
|
/** Partner configuration (required) */
|
|
322
|
-
partner:
|
|
320
|
+
partner: M,
|
|
323
321
|
// Optional sections (with defaults)
|
|
324
322
|
/** Template content and presets */
|
|
325
323
|
template: e(x, {}),
|
|
@@ -334,33 +332,33 @@ const p = {
|
|
|
334
332
|
/** Compiler configuration */
|
|
335
333
|
compiler: e(z, {}),
|
|
336
334
|
/** Callbacks and event handlers */
|
|
337
|
-
callbacks: e(
|
|
335
|
+
callbacks: e(Z, {})
|
|
338
336
|
});
|
|
339
337
|
export {
|
|
340
338
|
H as BlocksSchema,
|
|
341
|
-
|
|
339
|
+
Z as CallbacksSchema,
|
|
342
340
|
V as CompilerRuleSchema,
|
|
343
341
|
z as CompilerSchema,
|
|
344
|
-
|
|
342
|
+
w as CustomBlockTypeSchema,
|
|
345
343
|
G as CustomRuleSchema,
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
B as DefaultBlockTypeSchema,
|
|
345
|
+
N as DynamicContentListSchema,
|
|
348
346
|
S as DynamicContentNodeSchema,
|
|
349
|
-
|
|
347
|
+
E as DynamicContentSchema,
|
|
350
348
|
O as EditorSchema,
|
|
351
349
|
D as EmailHeaderSchema,
|
|
352
350
|
L as FallbackFontSchema,
|
|
353
351
|
U as FeaturesSchema,
|
|
354
|
-
|
|
352
|
+
Q as GuidoConfigSchema,
|
|
355
353
|
A as IdentitySchema,
|
|
356
|
-
|
|
354
|
+
P as LegacyRecommendationConfigSchema,
|
|
357
355
|
p as MessageType,
|
|
358
|
-
|
|
356
|
+
M as PartnerSchema,
|
|
359
357
|
l as ProductType,
|
|
360
358
|
j as RegexRuleSchema,
|
|
361
359
|
q as RemoveRuleSchema,
|
|
362
360
|
_ as ReplaceRuleSchema,
|
|
363
|
-
|
|
361
|
+
v as TemplateMigrationSchema,
|
|
364
362
|
x as TemplateSchema,
|
|
365
363
|
F as UISchema
|
|
366
364
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._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) : o._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), 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) : o._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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, n = [],
|
|
10
|
-
|
|
9
|
+
}, n = [], s = /* @__PURE__ */ a(
|
|
10
|
+
i,
|
|
11
11
|
t,
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"915d61d5"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const l = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
l as default
|
|
20
20
|
};
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import { defineComponent as J, defineAsyncComponent as
|
|
1
|
+
import { defineComponent as J, defineAsyncComponent as B, ref as U, computed as _, watch as N, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useEditorLock as Z } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as te } from "../composables/usePartner.js";
|
|
7
7
|
import { useStripo as ne } from "../composables/useStripo.js";
|
|
8
8
|
import { useTimerClone as re } from "../composables/useTimerClone.js";
|
|
9
|
-
import { migrate as
|
|
10
|
-
import { ModuleFolderDefaults as
|
|
9
|
+
import { migrate as O } from "../config/migrator/index.js";
|
|
10
|
+
import { ModuleFolderDefaults as P } from "../enums/defaults.js";
|
|
11
11
|
import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
|
|
12
|
-
import { useRecommendationExtensionStore as
|
|
13
|
-
import
|
|
12
|
+
import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import ae from "./organisms/AutoSaveController.vue.js";
|
|
14
14
|
import ce from "./organisms/base/Toaster.vue.js";
|
|
15
15
|
import de from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
16
|
import me from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
17
|
import le from "./organisms/LoadingWrapper.vue.js";
|
|
18
18
|
import ue from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
19
|
import pe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
-
import fe from "
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { useEditorStore as P } from "../stores/editor.js";
|
|
20
|
+
import { useStripoApi as fe } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as ve } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
|
|
23
|
+
import { useEditorStore as x } from "../stores/editor.js";
|
|
25
24
|
import { usePreviewStore as he } from "../stores/preview.js";
|
|
26
|
-
import { useTemplateStore as
|
|
25
|
+
import { useTemplateStore as Se } from "../stores/template.js";
|
|
27
26
|
import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
|
|
28
27
|
import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
|
|
29
|
-
const
|
|
28
|
+
const Ve = /* @__PURE__ */ J({
|
|
30
29
|
__name: "Guido",
|
|
31
30
|
props: {
|
|
32
31
|
config: null,
|
|
33
32
|
ready: { type: Boolean, default: !0 }
|
|
34
33
|
},
|
|
35
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
36
|
-
setup(W, { expose:
|
|
37
|
-
const
|
|
35
|
+
setup(W, { expose: G, emit: r }) {
|
|
36
|
+
const i = W, H = B(
|
|
38
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
39
|
-
),
|
|
38
|
+
), $ = B(
|
|
40
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
const c =
|
|
40
|
+
), h = U(), l = U(), u = ye(), S = ge(), t = ve();
|
|
41
|
+
i.ready && t.init(i.config);
|
|
42
|
+
const c = x(), z = he(), m = _(() => c.hasChanges), { isTestPartner: q } = te(), g = () => {
|
|
44
43
|
var o;
|
|
45
|
-
return (o =
|
|
46
|
-
},
|
|
44
|
+
return (o = h.value) == null ? void 0 : o.handleSave(!0);
|
|
45
|
+
}, b = (o) => {
|
|
47
46
|
c.loadingStatus = o;
|
|
48
47
|
};
|
|
49
|
-
Y(),
|
|
48
|
+
Y(), oe();
|
|
50
49
|
const p = () => {
|
|
51
50
|
var o, e;
|
|
52
51
|
return {
|
|
@@ -54,14 +53,14 @@ const Je = /* @__PURE__ */ J({
|
|
|
54
53
|
userId: t.userId,
|
|
55
54
|
username: t.username,
|
|
56
55
|
partnerName: t.partnerName,
|
|
57
|
-
savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) ||
|
|
58
|
-
defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
56
|
+
savedModulesFolderName: ((o = t.editor) == null ? void 0 : o.savedModulesFolderName) || P.SAVED_MODULES,
|
|
57
|
+
defaultModulesFolderName: ((e = t.editor) == null ? void 0 : e.defaultModulesFolderName) || P.DEFAULT_MODULES
|
|
59
58
|
};
|
|
60
|
-
}, { initPlugin: E, preloadRuntime: w } = ne(), { getDefaultTemplate:
|
|
59
|
+
}, { initPlugin: E, preloadRuntime: w } = ne(), { runExclusive: k } = Z(), { getDefaultTemplate: C } = fe(), { cloneTimersOnSave: D, hasTimerBlocks: T } = re(), K = _(() => {
|
|
61
60
|
var o;
|
|
62
61
|
return !((o = t.ui) != null && o.showHeader);
|
|
63
62
|
});
|
|
64
|
-
|
|
63
|
+
ee({
|
|
65
64
|
onBack: () => {
|
|
66
65
|
console.debug("guido:back"), r("back");
|
|
67
66
|
},
|
|
@@ -76,19 +75,19 @@ const Je = /* @__PURE__ */ J({
|
|
|
76
75
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
|
-
const
|
|
78
|
+
const F = (o) => {
|
|
80
79
|
console.debug("dynamic-content:close", o), u.setSelectedDynamicContent(o), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: o }));
|
|
81
|
-
},
|
|
80
|
+
}, I = () => {
|
|
82
81
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
83
82
|
};
|
|
84
|
-
|
|
83
|
+
N(() => m.value, () => {
|
|
85
84
|
r("on-change", m.value);
|
|
86
85
|
});
|
|
87
86
|
const f = (o) => {
|
|
88
87
|
const e = o, { attribute: s, position: d } = e.detail;
|
|
89
88
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
90
89
|
};
|
|
91
|
-
let
|
|
90
|
+
let a = null;
|
|
92
91
|
const v = () => {
|
|
93
92
|
var e;
|
|
94
93
|
const o = document.querySelector(se);
|
|
@@ -96,59 +95,59 @@ const Je = /* @__PURE__ */ J({
|
|
|
96
95
|
}, y = async () => {
|
|
97
96
|
var o;
|
|
98
97
|
try {
|
|
99
|
-
t.initialized || t.init(
|
|
100
|
-
const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
101
|
-
|
|
102
|
-
const
|
|
98
|
+
t.initialized || t.init(i.config), c.templateId = t.templateId;
|
|
99
|
+
const e = t.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
100
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
101
|
+
const M = ((o = e == null ? void 0 : e.migration) == null ? void 0 : o.recommendationConfigs) ?? {}, R = t.isFeatureEnabled("linkTrackingIds");
|
|
103
102
|
let n = {
|
|
104
|
-
html: s && await
|
|
103
|
+
html: s && await O(s, M),
|
|
105
104
|
css: d
|
|
106
105
|
};
|
|
107
|
-
n.html || (n = await
|
|
108
|
-
const
|
|
109
|
-
|
|
106
|
+
n.html || (n = await C(), n.html = await O(n.html, M));
|
|
107
|
+
const V = R ? A(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
108
|
+
T(n.html) && (n.html = await D(n.html)), R && (c.trackIdSessionFloor = Math.max(V, A(n.html)));
|
|
110
109
|
const j = {
|
|
111
|
-
preselectedDynamicContentList:
|
|
110
|
+
preselectedDynamicContentList: L,
|
|
112
111
|
onReady: () => {
|
|
113
112
|
console.debug("guido:ready"), r("ready");
|
|
114
113
|
}
|
|
115
114
|
};
|
|
116
|
-
await E(n, p(), j), u.selectedDynamicContentList =
|
|
115
|
+
await E(n, p(), j), u.selectedDynamicContentList = L;
|
|
117
116
|
} catch (e) {
|
|
118
117
|
console.error("Failed to initialize Stripo editor:", e);
|
|
119
118
|
}
|
|
120
119
|
};
|
|
121
120
|
return Q(async () => {
|
|
122
121
|
var e;
|
|
123
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
122
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), x().$reset(), Se().$reset(), v();
|
|
124
123
|
const o = (e = l.value) == null ? void 0 : e.parentElement;
|
|
125
|
-
if (o && (
|
|
124
|
+
if (o && (a = new ResizeObserver(v), a.observe(o)), w(), i.ready)
|
|
126
125
|
await y();
|
|
127
126
|
else {
|
|
128
|
-
const s =
|
|
127
|
+
const s = N(() => i.ready, (d) => {
|
|
129
128
|
d && (s(), y());
|
|
130
129
|
});
|
|
131
130
|
}
|
|
132
131
|
document.addEventListener("dynamic-content:open", f);
|
|
133
132
|
}), X(() => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
t.reset();
|
|
141
|
-
}),
|
|
133
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f), k(async () => {
|
|
134
|
+
try {
|
|
135
|
+
window.UIEditor.removeEditor();
|
|
136
|
+
} catch {
|
|
137
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
138
|
+
}
|
|
139
|
+
}), t.reset();
|
|
140
|
+
}), G({
|
|
142
141
|
dynamicContent: {
|
|
143
|
-
insert:
|
|
144
|
-
close:
|
|
142
|
+
insert: F,
|
|
143
|
+
close: I
|
|
145
144
|
},
|
|
146
145
|
hasChanges: m,
|
|
147
|
-
saveSilent:
|
|
148
|
-
setLoading:
|
|
149
|
-
}), { __sfc: !0, PreviewContainer:
|
|
146
|
+
saveSilent: g,
|
|
147
|
+
setLoading: b
|
|
148
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: t, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: g, setLoading: b, emit: r, buildMetadata: p, initPlugin: E, preloadRuntime: w, runExclusive: k, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: v, startEditor: y, AutoSaveController: ae, Toaster: ce, FilterSelectionDrawer: de, HeaderWrapper: me, LoadingWrapper: le, SaveAsTemplateDrawer: ue, UnsubscribeWrapper: pe };
|
|
150
149
|
}
|
|
151
150
|
});
|
|
152
151
|
export {
|
|
153
|
-
|
|
152
|
+
Ve as default
|
|
154
153
|
};
|
|
@@ -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
|
+
"fa75f9c3"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,97 +1,74 @@
|
|
|
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 tt } from "../../../utils/tooltipUtils.js";
|
|
20
|
-
import { InButtonV2 as ot } from "@useinsider/design-system-vue";
|
|
21
|
-
import { storeToRefs as et } from "pinia";
|
|
22
|
-
import rt from "./MigrationConfirmModal.vue.js";
|
|
23
|
-
const At = /* @__PURE__ */ R({
|
|
1
|
+
import { defineComponent as F, ref as a, computed as x } from "vue";
|
|
2
|
+
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as B } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as R } from "../../../composables/useSave.js";
|
|
8
|
+
import { useToaster as z } from "../../../composables/useToaster.js";
|
|
9
|
+
import { useTranslations as I } from "../../../composables/useTranslations.js";
|
|
10
|
+
import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
|
|
11
|
+
import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
|
|
12
|
+
import { useEditorStore as G } from "../../../stores/editor.js";
|
|
13
|
+
import { useTemplateStore as J } from "../../../stores/template.js";
|
|
14
|
+
import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
|
|
15
|
+
import { InButtonV2 as N } from "@useinsider/design-system-vue";
|
|
16
|
+
import { storeToRefs as Q } from "pinia";
|
|
17
|
+
import U from "./MigrationConfirmModal.vue.js";
|
|
18
|
+
const ft = /* @__PURE__ */ F({
|
|
24
19
|
__name: "EditorActions",
|
|
25
|
-
setup(
|
|
26
|
-
const { config:
|
|
20
|
+
setup(W, { expose: w }) {
|
|
21
|
+
const { config: n, isFeatureEnabled: l } = k(), { exportHtml: m } = B(), { save: u } = R(), { openVersionHistory: c, closeVersionHistory: p } = P(), { getCompiledEmail: f } = b(), { compileHtml: d } = L(), { validateLiquidSyntax: v } = j(), { handleError: y } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), r = I(), s = a(!1), i = a(!1), H = a(), V = D(), _ = () => {
|
|
27
22
|
if (e.isVersionHistoryOpen) {
|
|
28
|
-
|
|
23
|
+
p();
|
|
29
24
|
return;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
s.value = !0, await
|
|
34
|
-
},
|
|
26
|
+
c();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
s.value = !0, await m(), s.value = !1;
|
|
29
|
+
}, A = () => {
|
|
35
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
36
|
-
},
|
|
31
|
+
}, M = x(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), O = x(
|
|
37
32
|
() => {
|
|
38
33
|
var t, o;
|
|
39
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
40
35
|
}
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
), h = async (t) => {
|
|
37
|
+
i.value = !0, t || (e.loadingStatus = !0);
|
|
38
|
+
let o;
|
|
39
|
+
try {
|
|
40
|
+
o = await u(t);
|
|
41
|
+
} catch (T) {
|
|
42
|
+
y(T, "Failed to save template");
|
|
43
|
+
} finally {
|
|
44
|
+
i.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
50
45
|
}
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
try {
|
|
57
|
-
t = await d();
|
|
58
|
-
} catch (o) {
|
|
59
|
-
console.warn("Test-path validation failed; sending without the drawer.", o);
|
|
60
|
-
} finally {
|
|
61
|
-
e.loadingStatus = !1;
|
|
62
|
-
}
|
|
63
|
-
if (t.length) {
|
|
64
|
-
v({
|
|
65
|
-
type: U.Error,
|
|
66
|
-
message: r("email-editor.validation-errors-found"),
|
|
67
|
-
actionButton: {
|
|
68
|
-
text: r("email-editor.check-errors"),
|
|
69
|
-
onClick: () => w.open(t, "test")
|
|
70
|
-
},
|
|
71
|
-
autoHide: !1
|
|
72
|
-
});
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
n();
|
|
46
|
+
return o;
|
|
47
|
+
}, E = (t) => {
|
|
48
|
+
var o;
|
|
49
|
+
if (!t && S.value) {
|
|
50
|
+
(o = H.value) == null || o.open();
|
|
76
51
|
return;
|
|
77
52
|
}
|
|
78
|
-
|
|
53
|
+
return h(t);
|
|
54
|
+
}, q = async () => {
|
|
55
|
+
if (l("liquidSyntax")) {
|
|
79
56
|
e.loadingStatus = !0;
|
|
80
57
|
try {
|
|
81
|
-
const { html: t } = await
|
|
82
|
-
if (!await
|
|
58
|
+
const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
|
|
59
|
+
if (!await v(o))
|
|
83
60
|
return;
|
|
84
61
|
} finally {
|
|
85
62
|
e.loadingStatus = !1;
|
|
86
63
|
}
|
|
87
64
|
}
|
|
88
|
-
|
|
65
|
+
V();
|
|
89
66
|
};
|
|
90
|
-
return
|
|
91
|
-
handleSave:
|
|
92
|
-
}), { __sfc: !0, config:
|
|
67
|
+
return w({
|
|
68
|
+
handleSave: E
|
|
69
|
+
}), { __sfc: !0, config: n, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, handleError: y, editorStore: e, templateStore: g, hasMigrations: S, trans: r, isExporting: s, isSaving: i, migrationModalRef: H, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: h, handleSave: E, handleTestEmail: q, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
93
70
|
}
|
|
94
71
|
});
|
|
95
72
|
export {
|
|
96
|
-
|
|
73
|
+
ft as default
|
|
97
74
|
};
|