@useinsider/guido 2.0.0 → 2.1.0-beta.efb0c6b
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 +2 -0
- package/dist/@types/config/schemas.js +57 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -2
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +57 -56
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +6 -7
- package/dist/extensions/Blocks/controlFactories.js +122 -111
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +57 -52
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +34 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +10 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +181 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/stores/config.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,6 +110,7 @@ const config: GuidoConfigInput = {
|
|
|
110
110
|
css?: string,
|
|
111
111
|
preselectedDynamicContent?: DynamicContent[],
|
|
112
112
|
selectedUnsubscribePages?: number[],
|
|
113
|
+
forceRecreate?: boolean, // Default: false - Force recreate template in Stripo storage
|
|
113
114
|
},
|
|
114
115
|
|
|
115
116
|
// Optional: Editor settings
|
|
@@ -137,6 +138,7 @@ const config: GuidoConfigInput = {
|
|
|
137
138
|
testMessage?: boolean, // Default: true
|
|
138
139
|
displayConditions?: boolean, // Default: true
|
|
139
140
|
unsubscribe?: boolean, // Default: true
|
|
141
|
+
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
140
142
|
},
|
|
141
143
|
|
|
142
144
|
// Optional: Block configuration
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { object as o, number as
|
|
2
|
-
const
|
|
1
|
+
import { object as o, number as b, optional as e, string as t, pipe as u, picklist as n, custom as d, boolean as c, array as a, minLength as p, literal as r, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const m = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
5
5
|
/** Transactional/system emails */
|
|
@@ -13,22 +13,22 @@ const i = {
|
|
|
13
13
|
UNSUBSCRIBE_PAGES: 97
|
|
14
14
|
}, h = o({
|
|
15
15
|
/** Unique identifier for the template being edited */
|
|
16
|
-
templateId:
|
|
16
|
+
templateId: u(
|
|
17
17
|
t(),
|
|
18
|
-
|
|
18
|
+
p(1, "templateId is required")
|
|
19
19
|
),
|
|
20
20
|
/** Unique identifier for the user editing the template */
|
|
21
|
-
userId:
|
|
21
|
+
userId: u(
|
|
22
22
|
t(),
|
|
23
|
-
|
|
23
|
+
p(1, "userId is required")
|
|
24
24
|
),
|
|
25
25
|
/** Optional variation ID for A/B testing */
|
|
26
26
|
variationId: e(t())
|
|
27
27
|
}), k = o({
|
|
28
28
|
/** Partner/organization name (required) */
|
|
29
|
-
name:
|
|
29
|
+
name: u(
|
|
30
30
|
t(),
|
|
31
|
-
|
|
31
|
+
p(1, "partner.name is required")
|
|
32
32
|
),
|
|
33
33
|
/** Product type identifier */
|
|
34
34
|
productType: e(
|
|
@@ -41,8 +41,8 @@ const i = {
|
|
|
41
41
|
),
|
|
42
42
|
/** Message type (promotional or transactional) */
|
|
43
43
|
messageType: e(
|
|
44
|
-
n([
|
|
45
|
-
|
|
44
|
+
n([m.PROMOTIONAL, m.TRANSACTIONAL]),
|
|
45
|
+
m.PROMOTIONAL
|
|
46
46
|
),
|
|
47
47
|
/** Display name for the current user */
|
|
48
48
|
username: e(t(), "Guido User")
|
|
@@ -71,27 +71,29 @@ const i = {
|
|
|
71
71
|
[]
|
|
72
72
|
),
|
|
73
73
|
/** Selected unsubscribe page IDs */
|
|
74
|
-
selectedUnsubscribePages: e(a(
|
|
75
|
-
|
|
74
|
+
selectedUnsubscribePages: e(a(b()), []),
|
|
75
|
+
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
76
|
+
forceRecreate: e(c(), !1)
|
|
77
|
+
}), f = o({
|
|
76
78
|
/** Sender display name */
|
|
77
79
|
senderName: e(t(), ""),
|
|
78
80
|
/** Email subject line */
|
|
79
81
|
subject: e(t(), "")
|
|
80
|
-
}),
|
|
82
|
+
}), C = o({
|
|
81
83
|
/** Locale for the editor UI */
|
|
82
84
|
locale: e(t(), "en"),
|
|
83
85
|
/** Path to translations object */
|
|
84
86
|
translationsPath: e(t(), "window.trans.en"),
|
|
85
87
|
/** Migration date for template compatibility */
|
|
86
|
-
migrationDate: e(
|
|
88
|
+
migrationDate: e(b(), 1759696858),
|
|
87
89
|
/** Email header settings */
|
|
88
|
-
emailHeader: e(
|
|
89
|
-
}),
|
|
90
|
+
emailHeader: e(f, { senderName: "", subject: "" })
|
|
91
|
+
}), I = o({
|
|
90
92
|
/** Whether to show the header bar */
|
|
91
93
|
showHeader: e(c(), !0),
|
|
92
94
|
/** Custom label for back button (if shown) */
|
|
93
95
|
backButtonLabel: e(t())
|
|
94
|
-
}),
|
|
96
|
+
}), T = o({
|
|
95
97
|
/** Enable dynamic content insertion */
|
|
96
98
|
dynamicContent: e(c(), !0),
|
|
97
99
|
/** Enable save as template functionality */
|
|
@@ -103,8 +105,10 @@ const i = {
|
|
|
103
105
|
/** Enable display conditions */
|
|
104
106
|
displayConditions: e(c(), !0),
|
|
105
107
|
/** Enable unsubscribe block */
|
|
106
|
-
unsubscribe: e(c(), !0)
|
|
107
|
-
|
|
108
|
+
unsubscribe: e(c(), !0),
|
|
109
|
+
/** Disable modules panel in the editor */
|
|
110
|
+
modulesDisabled: e(c(), !1)
|
|
111
|
+
}), A = n([
|
|
108
112
|
"amp-accordion",
|
|
109
113
|
"amp-carousel",
|
|
110
114
|
"amp-form-controls",
|
|
@@ -129,7 +133,7 @@ const i = {
|
|
|
129
133
|
]), E = o({
|
|
130
134
|
/** Default blocks to exclude from the editor */
|
|
131
135
|
excludeDefaults: e(
|
|
132
|
-
a(
|
|
136
|
+
a(A),
|
|
133
137
|
[]
|
|
134
138
|
),
|
|
135
139
|
/** Custom blocks to include in the editor */
|
|
@@ -143,7 +147,7 @@ const i = {
|
|
|
143
147
|
/** Human-readable description */
|
|
144
148
|
description: e(t()),
|
|
145
149
|
/** Priority for rule ordering (lower = earlier) */
|
|
146
|
-
priority:
|
|
150
|
+
priority: b()
|
|
147
151
|
}), N = o({
|
|
148
152
|
...l.entries,
|
|
149
153
|
type: r("replace"),
|
|
@@ -172,20 +176,31 @@ const i = {
|
|
|
172
176
|
type: r("custom"),
|
|
173
177
|
/** Custom processor function */
|
|
174
178
|
processor: d(
|
|
175
|
-
(
|
|
179
|
+
(i) => typeof i == "function",
|
|
176
180
|
"processor must be a function"
|
|
177
181
|
)
|
|
178
|
-
}),
|
|
182
|
+
}), x = S("type", [
|
|
179
183
|
N,
|
|
180
184
|
O,
|
|
181
185
|
L,
|
|
182
186
|
v
|
|
183
|
-
]),
|
|
187
|
+
]), B = o({
|
|
184
188
|
/** Custom compiler rules to apply */
|
|
185
|
-
customRules: e(a(
|
|
189
|
+
customRules: e(a(x), []),
|
|
186
190
|
/** Skip default compiler rules */
|
|
187
191
|
ignoreDefaultRules: e(c(), !1)
|
|
188
|
-
}),
|
|
192
|
+
}), P = o({
|
|
193
|
+
/**
|
|
194
|
+
* External validation handler called before save completes.
|
|
195
|
+
* Return false to cancel the save operation.
|
|
196
|
+
*/
|
|
197
|
+
externalValidation: e(
|
|
198
|
+
d(
|
|
199
|
+
(i) => typeof i == "function",
|
|
200
|
+
"externalValidation must be a function"
|
|
201
|
+
)
|
|
202
|
+
)
|
|
203
|
+
}), D = o({
|
|
189
204
|
// Required sections
|
|
190
205
|
/** Identity configuration (required) */
|
|
191
206
|
identity: h,
|
|
@@ -195,35 +210,38 @@ const i = {
|
|
|
195
210
|
/** Template content and presets */
|
|
196
211
|
template: e(R, {}),
|
|
197
212
|
/** Editor settings */
|
|
198
|
-
editor: e(
|
|
213
|
+
editor: e(C, {}),
|
|
199
214
|
/** UI configuration */
|
|
200
|
-
ui: e(
|
|
215
|
+
ui: e(I, {}),
|
|
201
216
|
/** Feature toggles */
|
|
202
|
-
features: e(
|
|
217
|
+
features: e(T, {}),
|
|
203
218
|
/** Block configuration */
|
|
204
219
|
blocks: e(E, {}),
|
|
205
220
|
/** Compiler configuration */
|
|
206
|
-
compiler: e(
|
|
221
|
+
compiler: e(B, {}),
|
|
222
|
+
/** Callbacks and event handlers */
|
|
223
|
+
callbacks: e(P, {})
|
|
207
224
|
});
|
|
208
225
|
export {
|
|
209
226
|
E as BlocksSchema,
|
|
210
|
-
|
|
211
|
-
|
|
227
|
+
P as CallbacksSchema,
|
|
228
|
+
x as CompilerRuleSchema,
|
|
229
|
+
B as CompilerSchema,
|
|
212
230
|
g as CustomBlockTypeSchema,
|
|
213
231
|
v as CustomRuleSchema,
|
|
214
|
-
|
|
232
|
+
A as DefaultBlockTypeSchema,
|
|
215
233
|
y as DynamicContentSchema,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
234
|
+
C as EditorSchema,
|
|
235
|
+
f as EmailHeaderSchema,
|
|
236
|
+
T as FeaturesSchema,
|
|
237
|
+
D as GuidoConfigSchema,
|
|
220
238
|
h as IdentitySchema,
|
|
221
|
-
|
|
239
|
+
m as MessageType,
|
|
222
240
|
k as PartnerSchema,
|
|
223
241
|
s as ProductType,
|
|
224
242
|
O as RegexRuleSchema,
|
|
225
243
|
L as RemoveRuleSchema,
|
|
226
244
|
N as ReplaceRuleSchema,
|
|
227
245
|
R as TemplateSchema,
|
|
228
|
-
|
|
246
|
+
I as UISchema
|
|
229
247
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, defineAsyncComponent as P, ref as N, computed as U, watch as R, onMounted as z, onUnmounted as K } from "vue";
|
|
2
2
|
import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
|
|
3
3
|
import { usePartner as j } from "../composables/usePartner.js";
|
|
4
4
|
import { useStripo as q } from "../composables/useStripo.js";
|
|
@@ -15,8 +15,8 @@ import { useConfigStore as oe } from "../stores/config.js";
|
|
|
15
15
|
import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
|
|
16
16
|
import { useEditorStore as ne } from "../stores/editor.js";
|
|
17
17
|
import { usePreviewStore as re } from "../stores/preview.js";
|
|
18
|
-
import { useUnsubscribeStore as
|
|
19
|
-
const Ee = /* @__PURE__ */
|
|
18
|
+
import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
|
|
19
|
+
const Ee = /* @__PURE__ */ B({
|
|
20
20
|
__name: "Guido",
|
|
21
21
|
props: {
|
|
22
22
|
config: null
|
|
@@ -27,19 +27,19 @@ const Ee = /* @__PURE__ */ x({
|
|
|
27
27
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
28
28
|
), A = P(
|
|
29
29
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
30
|
-
), p =
|
|
30
|
+
), p = N(), c = te(), u = se(), n = oe();
|
|
31
31
|
n.init(l.config);
|
|
32
32
|
const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
|
|
33
33
|
var e;
|
|
34
34
|
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
35
|
-
}, { templateId: a, userId: y, partnerName: h, productType:
|
|
35
|
+
}, { templateId: a, userId: y, partnerName: h, productType: b, username: f, template: o } = n, s = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
|
|
36
36
|
i.templateId = a;
|
|
37
37
|
const { initPlugin: S } = q({
|
|
38
38
|
emailId: a,
|
|
39
39
|
userId: y,
|
|
40
|
-
username:
|
|
40
|
+
username: f,
|
|
41
41
|
partnerName: h,
|
|
42
|
-
productType:
|
|
42
|
+
productType: b,
|
|
43
43
|
preselectedDynamicContentList: m,
|
|
44
44
|
onReady: () => {
|
|
45
45
|
console.debug("guido:ready"), t("ready");
|
|
@@ -63,28 +63,26 @@ const Ee = /* @__PURE__ */ x({
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
const E = (e) => {
|
|
66
|
-
console.debug("dynamic-content:close", e),
|
|
66
|
+
console.debug("dynamic-content:close", e), c.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
67
67
|
}, k = () => {
|
|
68
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
R(() => r.value, () => {
|
|
71
71
|
t("on-change", r.value);
|
|
72
72
|
});
|
|
73
73
|
const d = (e) => {
|
|
74
|
-
const T = e, { attribute: O, position:
|
|
75
|
-
console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O,
|
|
74
|
+
const T = e, { attribute: O, position: x } = T.detail;
|
|
75
|
+
console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, x);
|
|
76
76
|
};
|
|
77
77
|
return z(async () => {
|
|
78
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
79
79
|
try {
|
|
80
80
|
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
81
81
|
let e = {
|
|
82
|
-
html:
|
|
83
|
-
css: g
|
|
84
|
-
forceRecreate: !0
|
|
85
|
-
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
82
|
+
html: s && await W(s),
|
|
83
|
+
css: g
|
|
86
84
|
};
|
|
87
|
-
e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e),
|
|
85
|
+
e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), c.selectedDynamicContentList = m;
|
|
88
86
|
} catch (e) {
|
|
89
87
|
console.error("Failed to initialize Stripo editor:", e);
|
|
90
88
|
}
|
|
@@ -104,7 +102,7 @@ const Ee = /* @__PURE__ */ x({
|
|
|
104
102
|
},
|
|
105
103
|
hasChanges: r,
|
|
106
104
|
saveSilent: v
|
|
107
|
-
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore:
|
|
105
|
+
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: c, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: b, username: f, templateConfig: o, html: s, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
|
|
108
106
|
}
|
|
109
107
|
});
|
|
110
108
|
export {
|
|
@@ -3,7 +3,7 @@ import o from "./AmpToggle.vue2.js";
|
|
|
3
3
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var s = function() {
|
|
5
5
|
var r = this, t = r._self._c, e = r._self._setupProxy;
|
|
6
|
-
return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-
|
|
6
|
+
return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-3 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
|
|
7
7
|
return e.previewStore.openErrorModal();
|
|
8
8
|
} } }) : r._e()], 1)]);
|
|
9
9
|
}, a = [], i = /* @__PURE__ */ n(
|
|
@@ -12,7 +12,7 @@ var s = function() {
|
|
|
12
12
|
a,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"5196584c"
|
|
16
16
|
);
|
|
17
17
|
const d = i.exports;
|
|
18
18
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as c, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
13
|
+
setup(k, { expose: u }) {
|
|
14
|
+
const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
|
|
15
15
|
if (o.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, y = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
22
|
+
}, S = () => {
|
|
23
23
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
},
|
|
24
|
+
}, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
25
|
s.value = !0, o.loadingStatus = !0;
|
|
26
|
-
const
|
|
27
|
-
return s.value = !1, p && (o.loadingStatus = !1),
|
|
26
|
+
const m = await n(p);
|
|
27
|
+
return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return u({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
const
|
|
4
|
-
const e =
|
|
1
|
+
import { useConfigStore as I } from "../stores/config.js";
|
|
2
|
+
import { storeToRefs as T } from "pinia";
|
|
3
|
+
const w = () => {
|
|
4
|
+
const e = I(), {
|
|
5
5
|
config: t,
|
|
6
6
|
initialized: o,
|
|
7
7
|
identity: r,
|
|
8
8
|
partner: i,
|
|
9
|
-
template:
|
|
10
|
-
editor:
|
|
9
|
+
template: a,
|
|
10
|
+
editor: n,
|
|
11
11
|
ui: s,
|
|
12
|
-
features:
|
|
13
|
-
blocks:
|
|
14
|
-
compiler:
|
|
15
|
-
|
|
12
|
+
features: c,
|
|
13
|
+
blocks: u,
|
|
14
|
+
compiler: d,
|
|
15
|
+
callbacks: l,
|
|
16
|
+
templateId: p,
|
|
16
17
|
userId: f,
|
|
17
18
|
variationId: m,
|
|
18
19
|
partnerName: g,
|
|
19
|
-
productType:
|
|
20
|
-
messageType:
|
|
21
|
-
username:
|
|
22
|
-
showHeader:
|
|
23
|
-
} =
|
|
20
|
+
productType: b,
|
|
21
|
+
messageType: C,
|
|
22
|
+
username: y,
|
|
23
|
+
showHeader: E
|
|
24
|
+
} = T(e);
|
|
24
25
|
return {
|
|
25
26
|
// State refs
|
|
26
27
|
config: t,
|
|
@@ -28,26 +29,27 @@ const k = () => {
|
|
|
28
29
|
// Section refs
|
|
29
30
|
identity: r,
|
|
30
31
|
partner: i,
|
|
31
|
-
template:
|
|
32
|
-
editor:
|
|
32
|
+
template: a,
|
|
33
|
+
editor: n,
|
|
33
34
|
ui: s,
|
|
34
|
-
features:
|
|
35
|
-
blocks:
|
|
36
|
-
compiler:
|
|
35
|
+
features: c,
|
|
36
|
+
blocks: u,
|
|
37
|
+
compiler: d,
|
|
38
|
+
callbacks: l,
|
|
37
39
|
// Convenience refs
|
|
38
|
-
templateId:
|
|
40
|
+
templateId: p,
|
|
39
41
|
userId: f,
|
|
40
42
|
variationId: m,
|
|
41
43
|
partnerName: g,
|
|
42
|
-
productType:
|
|
43
|
-
messageType:
|
|
44
|
-
username:
|
|
45
|
-
showHeader:
|
|
44
|
+
productType: b,
|
|
45
|
+
messageType: C,
|
|
46
|
+
username: y,
|
|
47
|
+
showHeader: E,
|
|
46
48
|
// Methods
|
|
47
49
|
getConfig: () => t.value,
|
|
48
|
-
isFeatureEnabled: (
|
|
50
|
+
isFeatureEnabled: (F) => e.isFeatureEnabled(F)
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
w as useConfig
|
|
53
55
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useConfig as l } from "./useConfig.js";
|
|
2
|
+
import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
|
|
3
|
+
import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
|
|
4
|
+
import { useHtmlValidator as p } from "./useHtmlValidator.js";
|
|
5
|
+
const w = () => {
|
|
6
|
+
const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
|
|
7
|
+
return { save: async (r = !1) => {
|
|
8
|
+
var e;
|
|
9
|
+
i();
|
|
10
|
+
const { prepareTemplateDetails: n } = d(), t = await n();
|
|
11
|
+
if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
|
|
12
|
+
return r || s(t), t;
|
|
11
13
|
} };
|
|
12
14
|
};
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
w as useSave
|
|
15
17
|
};
|