@useinsider/guido 2.1.0-beta.a720424 → 2.1.0-beta.acbfaec
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 +45 -0
- package/dist/@types/config/schemas.js +58 -54
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +71 -60
- package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
- package/dist/composables/useActionsApi.js +15 -13
- package/dist/composables/useBlocksConfig.js +29 -20
- package/dist/config/migrator/itemsBlockMigrator.js +140 -123
- package/dist/enums/defaults.js +9 -4
- package/dist/extensions/Blocks/Items/block.js +19 -28
- package/dist/extensions/Blocks/Items/controls/button/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +124 -85
- package/dist/extensions/Blocks/Items/controls/image/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +28 -40
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +35 -47
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +49 -54
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +42 -51
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +23 -36
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +45 -57
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -60
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +189 -196
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -2
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/settingsPanel.js +10 -15
- package/dist/extensions/Blocks/Items/template.js +181 -175
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
- package/dist/extensions/Blocks/common-control.js +91 -92
- package/dist/extensions/ModulesTabIcons/extension.js +16 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +163 -95
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/enums/defaults.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +5 -5
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -5
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +10 -12
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -5
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/package.json +2 -2
- package/dist/extensions/Blocks/Items/store/items-block.js +0 -79
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -45
package/README.md
CHANGED
|
@@ -122,6 +122,8 @@ const config: GuidoConfigInput = {
|
|
|
122
122
|
senderName?: string,
|
|
123
123
|
subject?: string,
|
|
124
124
|
},
|
|
125
|
+
savedModulesFolderName?: string, // Default: 'savedModules' → sent as guido_{partnerName}_{value}
|
|
126
|
+
defaultModulesFolderName?: string, // Default: 'defaultModules' → sent as guido_{value}
|
|
125
127
|
},
|
|
126
128
|
|
|
127
129
|
// Optional: UI settings
|
|
@@ -141,6 +143,11 @@ const config: GuidoConfigInput = {
|
|
|
141
143
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
142
144
|
},
|
|
143
145
|
|
|
146
|
+
// Optional: Callbacks
|
|
147
|
+
callbacks?: {
|
|
148
|
+
externalValidation?: (data: SavedTemplateDetails) => Promise<boolean>, // Return false to cancel save
|
|
149
|
+
},
|
|
150
|
+
|
|
144
151
|
// Optional: Block configuration
|
|
145
152
|
blocks?: {
|
|
146
153
|
excludeDefaults?: DefaultBlockType[],
|
|
@@ -251,6 +258,44 @@ const config: GuidoConfigInput = {
|
|
|
251
258
|
|
|
252
259
|
---
|
|
253
260
|
|
|
261
|
+
## Module Folder Configuration
|
|
262
|
+
|
|
263
|
+
Customize the Stripo module folder names for saved and default modules:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
const config: GuidoConfigInput = {
|
|
267
|
+
identity: { templateId: 'tpl-123', userId: 'user-456' },
|
|
268
|
+
partner: { name: 'acme' },
|
|
269
|
+
editor: {
|
|
270
|
+
// Custom folder for user-saved modules
|
|
271
|
+
// Sent to Stripo as: guido_acme_myCustomModules
|
|
272
|
+
savedModulesFolderName: 'myCustomModules',
|
|
273
|
+
|
|
274
|
+
// Custom folder for default/prebuilt modules
|
|
275
|
+
// Sent to Stripo as: guido_myPrebuilts
|
|
276
|
+
defaultModulesFolderName: 'myPrebuilts',
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Folder Naming Convention
|
|
282
|
+
|
|
283
|
+
| Config Option | Default Value | Stripo Folder Name |
|
|
284
|
+
|--------------|---------------|-------------------|
|
|
285
|
+
| `savedModulesFolderName` | `'savedModules'` | `guido_{partnerName}_{value}` |
|
|
286
|
+
| `defaultModulesFolderName` | `'defaultModules'` | `guido_{value}` |
|
|
287
|
+
|
|
288
|
+
**Examples with partner name `acme`:**
|
|
289
|
+
|
|
290
|
+
| Config Value | Result |
|
|
291
|
+
|--------------|--------|
|
|
292
|
+
| `savedModulesFolderName: 'savedModules'` (default) | `guido_acme_savedModules` |
|
|
293
|
+
| `savedModulesFolderName: 'v2_modules'` | `guido_acme_v2_modules` |
|
|
294
|
+
| `defaultModulesFolderName: 'defaultModules'` (default) | `guido_defaultModules` |
|
|
295
|
+
| `defaultModulesFolderName: 'prebuilts'` | `guido_prebuilts` |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
254
299
|
## HTML Compiler Rules
|
|
255
300
|
|
|
256
301
|
Add custom rules to transform HTML during export:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { object as o, number as
|
|
1
|
+
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, custom as b, boolean as a, array as c, minLength as d, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
|
|
2
2
|
const m = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
@@ -15,12 +15,12 @@ const m = {
|
|
|
15
15
|
/** Unique identifier for the template being edited */
|
|
16
16
|
templateId: u(
|
|
17
17
|
t(),
|
|
18
|
-
|
|
18
|
+
d(1, "templateId is required")
|
|
19
19
|
),
|
|
20
20
|
/** Unique identifier for the user editing the template */
|
|
21
21
|
userId: u(
|
|
22
22
|
t(),
|
|
23
|
-
|
|
23
|
+
d(1, "userId is required")
|
|
24
24
|
),
|
|
25
25
|
/** Optional variation ID for A/B testing */
|
|
26
26
|
variationId: e(t())
|
|
@@ -28,7 +28,7 @@ const m = {
|
|
|
28
28
|
/** Partner/organization name (required) */
|
|
29
29
|
name: u(
|
|
30
30
|
t(),
|
|
31
|
-
|
|
31
|
+
d(1, "partner.name is required")
|
|
32
32
|
),
|
|
33
33
|
/** Product type identifier */
|
|
34
34
|
productType: e(
|
|
@@ -60,21 +60,21 @@ const m = {
|
|
|
60
60
|
value: t()
|
|
61
61
|
})
|
|
62
62
|
)
|
|
63
|
-
}),
|
|
63
|
+
}), f = o({
|
|
64
64
|
/** Initial HTML content */
|
|
65
65
|
html: e(t(), ""),
|
|
66
66
|
/** Initial CSS content */
|
|
67
67
|
css: e(t(), ""),
|
|
68
68
|
/** Preselected dynamic content items */
|
|
69
69
|
preselectedDynamicContent: e(
|
|
70
|
-
|
|
70
|
+
c(y),
|
|
71
71
|
[]
|
|
72
72
|
),
|
|
73
73
|
/** Selected unsubscribe page IDs */
|
|
74
|
-
selectedUnsubscribePages: e(
|
|
74
|
+
selectedUnsubscribePages: e(c(p()), []),
|
|
75
75
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
76
|
-
forceRecreate: e(
|
|
77
|
-
}),
|
|
76
|
+
forceRecreate: e(a(), !1)
|
|
77
|
+
}), R = o({
|
|
78
78
|
/** Sender display name */
|
|
79
79
|
senderName: e(t(), ""),
|
|
80
80
|
/** Email subject line */
|
|
@@ -85,29 +85,33 @@ const m = {
|
|
|
85
85
|
/** Path to translations object */
|
|
86
86
|
translationsPath: e(t(), "window.trans[Object.keys(window.trans)[0]]"),
|
|
87
87
|
/** Migration date for template compatibility */
|
|
88
|
-
migrationDate: e(
|
|
88
|
+
migrationDate: e(p(), 1759696858),
|
|
89
89
|
/** Email header settings */
|
|
90
|
-
emailHeader: e(
|
|
90
|
+
emailHeader: e(R, { senderName: "", subject: "" }),
|
|
91
|
+
/** Custom folder name for user-saved modules (sent to Stripo as guido_{partnerName}_{savedModulesFolderName}) */
|
|
92
|
+
savedModulesFolderName: e(t(), "savedModules"),
|
|
93
|
+
/** Custom folder name for default/prebuilt modules (sent to Stripo as guido_{defaultModulesFolderName}) */
|
|
94
|
+
defaultModulesFolderName: e(t(), "defaultModules")
|
|
91
95
|
}), I = o({
|
|
92
96
|
/** Whether to show the header bar */
|
|
93
|
-
showHeader: e(
|
|
97
|
+
showHeader: e(a(), !0),
|
|
94
98
|
/** Custom label for back button (if shown) */
|
|
95
99
|
backButtonLabel: e(t())
|
|
96
100
|
}), T = o({
|
|
97
101
|
/** Enable dynamic content insertion */
|
|
98
|
-
dynamicContent: e(
|
|
102
|
+
dynamicContent: e(a(), !0),
|
|
99
103
|
/** Enable save as template functionality */
|
|
100
|
-
saveAsTemplate: e(
|
|
104
|
+
saveAsTemplate: e(a(), !0),
|
|
101
105
|
/** Enable version history */
|
|
102
|
-
versionHistory: e(
|
|
106
|
+
versionHistory: e(a(), !0),
|
|
103
107
|
/** Enable test message sending */
|
|
104
|
-
testMessage: e(
|
|
108
|
+
testMessage: e(a(), !0),
|
|
105
109
|
/** Enable display conditions */
|
|
106
|
-
displayConditions: e(
|
|
110
|
+
displayConditions: e(a(), !0),
|
|
107
111
|
/** Enable unsubscribe block */
|
|
108
|
-
unsubscribe: e(
|
|
112
|
+
unsubscribe: e(a(), !0),
|
|
109
113
|
/** Disable modules panel in the editor */
|
|
110
|
-
modulesDisabled: e(
|
|
114
|
+
modulesDisabled: e(a(), !1)
|
|
111
115
|
}), A = n([
|
|
112
116
|
"amp-accordion",
|
|
113
117
|
"amp-carousel",
|
|
@@ -130,15 +134,15 @@ const m = {
|
|
|
130
134
|
"unsubscribe-block",
|
|
131
135
|
"coupon-block",
|
|
132
136
|
"items-block"
|
|
133
|
-
]),
|
|
137
|
+
]), N = o({
|
|
134
138
|
/** Default blocks to exclude from the editor */
|
|
135
139
|
excludeDefaults: e(
|
|
136
|
-
|
|
140
|
+
c(A),
|
|
137
141
|
[]
|
|
138
142
|
),
|
|
139
143
|
/** Custom blocks to include in the editor */
|
|
140
144
|
includeCustoms: e(
|
|
141
|
-
|
|
145
|
+
c(g),
|
|
142
146
|
[]
|
|
143
147
|
)
|
|
144
148
|
}), l = o({
|
|
@@ -147,8 +151,8 @@ const m = {
|
|
|
147
151
|
/** Human-readable description */
|
|
148
152
|
description: e(t()),
|
|
149
153
|
/** Priority for rule ordering (lower = earlier) */
|
|
150
|
-
priority:
|
|
151
|
-
}),
|
|
154
|
+
priority: p()
|
|
155
|
+
}), M = o({
|
|
152
156
|
...l.entries,
|
|
153
157
|
type: r("replace"),
|
|
154
158
|
/** String to search for */
|
|
@@ -156,8 +160,8 @@ const m = {
|
|
|
156
160
|
/** Replacement string */
|
|
157
161
|
replacement: t(),
|
|
158
162
|
/** Replace all occurrences (default: false) */
|
|
159
|
-
replaceAll: e(
|
|
160
|
-
}),
|
|
163
|
+
replaceAll: e(a())
|
|
164
|
+
}), O = o({
|
|
161
165
|
...l.entries,
|
|
162
166
|
type: r("regex"),
|
|
163
167
|
/** Regex pattern string */
|
|
@@ -166,36 +170,36 @@ const m = {
|
|
|
166
170
|
replacement: t(),
|
|
167
171
|
/** Regex flags (e.g., 'gi') */
|
|
168
172
|
flags: e(t())
|
|
169
|
-
}),
|
|
173
|
+
}), v = o({
|
|
170
174
|
...l.entries,
|
|
171
175
|
type: r("remove"),
|
|
172
176
|
/** Strings or patterns to remove */
|
|
173
|
-
targets:
|
|
174
|
-
}),
|
|
177
|
+
targets: c(t())
|
|
178
|
+
}), E = o({
|
|
175
179
|
...l.entries,
|
|
176
180
|
type: r("custom"),
|
|
177
181
|
/** Custom processor function */
|
|
178
|
-
processor:
|
|
182
|
+
processor: b(
|
|
179
183
|
(i) => typeof i == "function",
|
|
180
184
|
"processor must be a function"
|
|
181
185
|
)
|
|
182
|
-
}),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
]),
|
|
186
|
+
}), L = k("type", [
|
|
187
|
+
M,
|
|
188
|
+
O,
|
|
189
|
+
v,
|
|
190
|
+
E
|
|
191
|
+
]), x = o({
|
|
188
192
|
/** Custom compiler rules to apply */
|
|
189
|
-
customRules: e(
|
|
193
|
+
customRules: e(c(L), []),
|
|
190
194
|
/** Skip default compiler rules */
|
|
191
|
-
ignoreDefaultRules: e(
|
|
192
|
-
}),
|
|
195
|
+
ignoreDefaultRules: e(a(), !1)
|
|
196
|
+
}), B = o({
|
|
193
197
|
/**
|
|
194
198
|
* External validation handler called before save completes.
|
|
195
199
|
* Return false to cancel the save operation.
|
|
196
200
|
*/
|
|
197
201
|
externalValidation: e(
|
|
198
|
-
|
|
202
|
+
b(
|
|
199
203
|
(i) => typeof i == "function",
|
|
200
204
|
"externalValidation must be a function"
|
|
201
205
|
)
|
|
@@ -208,7 +212,7 @@ const m = {
|
|
|
208
212
|
partner: h,
|
|
209
213
|
// Optional sections (with defaults)
|
|
210
214
|
/** Template content and presets */
|
|
211
|
-
template: e(
|
|
215
|
+
template: e(f, {}),
|
|
212
216
|
/** Editor settings */
|
|
213
217
|
editor: e(C, {}),
|
|
214
218
|
/** UI configuration */
|
|
@@ -216,32 +220,32 @@ const m = {
|
|
|
216
220
|
/** Feature toggles */
|
|
217
221
|
features: e(T, {}),
|
|
218
222
|
/** Block configuration */
|
|
219
|
-
blocks: e(
|
|
223
|
+
blocks: e(N, {}),
|
|
220
224
|
/** Compiler configuration */
|
|
221
|
-
compiler: e(
|
|
225
|
+
compiler: e(x, {}),
|
|
222
226
|
/** Callbacks and event handlers */
|
|
223
|
-
callbacks: e(
|
|
227
|
+
callbacks: e(B, {})
|
|
224
228
|
});
|
|
225
229
|
export {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
N as BlocksSchema,
|
|
231
|
+
B as CallbacksSchema,
|
|
232
|
+
L as CompilerRuleSchema,
|
|
233
|
+
x as CompilerSchema,
|
|
230
234
|
g as CustomBlockTypeSchema,
|
|
231
|
-
|
|
235
|
+
E as CustomRuleSchema,
|
|
232
236
|
A as DefaultBlockTypeSchema,
|
|
233
237
|
y as DynamicContentSchema,
|
|
234
238
|
C as EditorSchema,
|
|
235
|
-
|
|
239
|
+
R as EmailHeaderSchema,
|
|
236
240
|
T as FeaturesSchema,
|
|
237
241
|
D as GuidoConfigSchema,
|
|
238
242
|
S as IdentitySchema,
|
|
239
243
|
m as MessageType,
|
|
240
244
|
h as PartnerSchema,
|
|
241
245
|
s as ProductType,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
+
O as RegexRuleSchema,
|
|
247
|
+
v as RemoveRuleSchema,
|
|
248
|
+
M as ReplaceRuleSchema,
|
|
249
|
+
f as TemplateSchema,
|
|
246
250
|
I as UISchema
|
|
247
251
|
};
|
|
@@ -1,54 +1,65 @@
|
|
|
1
|
-
import { defineComponent as B, defineAsyncComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { defineComponent as B, defineAsyncComponent as U, ref as X, computed as L, watch as z, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { provideGuidoActions as j } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as q } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as J } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as Q } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as N } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as a } from "../enums/defaults.js";
|
|
8
|
+
import Y from "./organisms/base/Toaster.vue.js";
|
|
9
|
+
import Z from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
10
|
+
import ee from "./organisms/header/HeaderWrapper.vue.js";
|
|
11
|
+
import oe from "./organisms/LoadingWrapper.vue.js";
|
|
12
|
+
import te from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
13
|
+
import ne from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
14
|
+
import { useStripoApi as re } from "../services/stripoApi.js";
|
|
15
|
+
import { useConfigStore as se } from "../stores/config.js";
|
|
16
|
+
import { useDynamicContentStore as ce } from "../stores/dynamic-content.js";
|
|
17
|
+
import { useEditorStore as ae } from "../stores/editor.js";
|
|
18
|
+
import { usePreviewStore as ie } from "../stores/preview.js";
|
|
19
|
+
import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
|
|
20
|
+
const ke = /* @__PURE__ */ B({
|
|
20
21
|
__name: "Guido",
|
|
21
22
|
props: {
|
|
22
23
|
config: null
|
|
23
24
|
},
|
|
24
25
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
26
|
+
setup(I, { expose: A, emit: t }) {
|
|
27
|
+
const v = I, W = U(
|
|
27
28
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
28
|
-
),
|
|
29
|
+
), O = U(
|
|
29
30
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
const
|
|
31
|
+
), y = X(), i = ce(), f = de(), r = se();
|
|
32
|
+
r.init(v.config);
|
|
33
|
+
const d = ae(), $ = ie(), s = L(() => d.hasChanges), { isTestPartner: R } = q(), h = () => {
|
|
33
34
|
var e;
|
|
34
|
-
return (e =
|
|
35
|
-
}, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
username:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
return (e = y.value) == null ? void 0 : e.handleSave(!0);
|
|
36
|
+
}, {
|
|
37
|
+
templateId: m,
|
|
38
|
+
userId: b,
|
|
39
|
+
partnerName: l,
|
|
40
|
+
productType: S,
|
|
41
|
+
username: g,
|
|
42
|
+
template: o,
|
|
43
|
+
editor: n
|
|
44
|
+
} = r, c = (o == null ? void 0 : o.html) || "", w = (o == null ? void 0 : o.css) || "", u = (o == null ? void 0 : o.preselectedDynamicContent) || [], D = (n == null ? void 0 : n.savedModulesFolderName) || a.SAVED_MODULES, E = (n == null ? void 0 : n.defaultModulesFolderName) || a.DEFAULT_MODULES;
|
|
45
|
+
d.templateId = m;
|
|
46
|
+
const { initPlugin: F } = J({
|
|
47
|
+
emailId: m,
|
|
48
|
+
userId: b,
|
|
49
|
+
username: g,
|
|
50
|
+
partnerName: l,
|
|
51
|
+
productType: S,
|
|
52
|
+
preselectedDynamicContentList: u,
|
|
53
|
+
savedModulesFolderName: `${a.PREFIX}_${l}_${D}`,
|
|
54
|
+
defaultModulesFolderName: `${a.PREFIX}_${E}`,
|
|
44
55
|
onReady: () => {
|
|
45
56
|
console.debug("guido:ready"), t("ready");
|
|
46
57
|
}
|
|
47
|
-
}), { getDefaultTemplate:
|
|
58
|
+
}), { getDefaultTemplate: C } = re(), { cloneTimersOnSave: _, hasTimerBlocks: M } = Q(), G = L(() => {
|
|
48
59
|
var e;
|
|
49
|
-
return !((e =
|
|
60
|
+
return !((e = r.ui) != null && e.showHeader);
|
|
50
61
|
});
|
|
51
|
-
|
|
62
|
+
j({
|
|
52
63
|
onBack: () => {
|
|
53
64
|
console.debug("guido:back"), t("back");
|
|
54
65
|
},
|
|
@@ -62,49 +73,49 @@ const Ee = /* @__PURE__ */ B({
|
|
|
62
73
|
console.debug("guido:test-email:click"), t("test-email:click");
|
|
63
74
|
}
|
|
64
75
|
});
|
|
65
|
-
const
|
|
66
|
-
console.debug("dynamic-content:close", e),
|
|
76
|
+
const T = (e) => {
|
|
77
|
+
console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
67
78
|
}, k = () => {
|
|
68
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
69
80
|
};
|
|
70
|
-
|
|
71
|
-
t("on-change",
|
|
81
|
+
z(() => s.value, () => {
|
|
82
|
+
t("on-change", s.value);
|
|
72
83
|
});
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const p = (e) => {
|
|
85
|
+
const P = e, { attribute: H, position: x } = P.detail;
|
|
86
|
+
console.debug("dynamic-content:open", P.detail), t("dynamic-content:open", H, x);
|
|
76
87
|
};
|
|
77
|
-
return
|
|
88
|
+
return K(async () => {
|
|
78
89
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
79
90
|
try {
|
|
80
|
-
|
|
91
|
+
f.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
81
92
|
let e = {
|
|
82
|
-
html:
|
|
83
|
-
css:
|
|
93
|
+
html: c && await N(c),
|
|
94
|
+
css: w
|
|
84
95
|
};
|
|
85
|
-
e.html || (e = await
|
|
96
|
+
e.html || (e = await C(), e.html = await N(e.html)), M(e.html) && (e.html = await _(e.html)), await F(e), i.selectedDynamicContentList = u;
|
|
86
97
|
} catch (e) {
|
|
87
98
|
console.error("Failed to initialize Stripo editor:", e);
|
|
88
99
|
}
|
|
89
|
-
document.addEventListener("dynamic-content:open",
|
|
90
|
-
}),
|
|
91
|
-
document.removeEventListener("dynamic-content:open",
|
|
100
|
+
document.addEventListener("dynamic-content:open", p);
|
|
101
|
+
}), V(() => {
|
|
102
|
+
document.removeEventListener("dynamic-content:open", p);
|
|
92
103
|
try {
|
|
93
104
|
window.UIEditor.removeEditor();
|
|
94
105
|
} catch {
|
|
95
106
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
96
107
|
}
|
|
97
|
-
|
|
98
|
-
}),
|
|
108
|
+
r.reset();
|
|
109
|
+
}), A({
|
|
99
110
|
dynamicContent: {
|
|
100
|
-
insert:
|
|
111
|
+
insert: T,
|
|
101
112
|
close: k
|
|
102
113
|
},
|
|
103
|
-
hasChanges:
|
|
104
|
-
saveSilent:
|
|
105
|
-
}), { __sfc: !0, PreviewContainer:
|
|
114
|
+
hasChanges: s,
|
|
115
|
+
saveSilent: h
|
|
116
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: O, headerWrapperRef: y, dynamicContentStore: i, unsubscribeStore: f, props: v, configStore: r, editorStore: d, previewStore: $, hasChanges: s, isTestPartner: R, saveSilent: h, templateId: m, userId: b, partnerName: l, productType: S, username: g, templateConfig: o, editorConfig: n, html: c, css: w, preselectedDynamicContentList: u, savedModulesFolderName: D, defaultModulesFolderName: E, emit: t, initPlugin: F, getDefaultTemplate: C, cloneTimersOnSave: _, hasTimerBlocks: M, noHeader: G, insertDynamicContent: T, closeDynamicContent: k, handleDynamicContentOpen: p, Toaster: Y, FilterSelectionDrawer: Z, HeaderWrapper: ee, LoadingWrapper: oe, SaveAsTemplateDrawer: te, UnsubscribeWrapper: ne };
|
|
106
117
|
}
|
|
107
118
|
});
|
|
108
119
|
export {
|
|
109
|
-
|
|
120
|
+
ke as default
|
|
110
121
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import o from "./HeaderWrapper.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
5
|
var t = this, r = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
|
|
7
|
-
},
|
|
6
|
+
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0", "data-testid": "guido-header" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
|
|
7
|
+
}, d = [], i = /* @__PURE__ */ a(
|
|
8
8
|
o,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
s,
|
|
10
|
+
d,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"5c02dcc7"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const p = i.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
p as default
|
|
18
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useToaster as w } from "./useToaster.js";
|
|
2
2
|
const v = () => {
|
|
3
|
-
const { handleError:
|
|
3
|
+
const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
|
|
4
4
|
const o = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
@@ -21,9 +21,9 @@ const v = () => {
|
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
23
|
}, ...t }, s = {
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
26
|
-
html:
|
|
24
|
+
callback: (l, r, d, c, u) => {
|
|
25
|
+
l ? a(l) : e({
|
|
26
|
+
html: r,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
@@ -34,15 +34,15 @@ const v = () => {
|
|
|
34
34
|
window.StripoEditorApi.actionsApi.compileEmail(s);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
|
-
getCompiledEmail:
|
|
37
|
+
getCompiledEmail: m,
|
|
38
38
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html: a, css: i, width: o, height:
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
|
|
40
40
|
html: a,
|
|
41
41
|
css: i,
|
|
42
42
|
width: o,
|
|
43
|
-
height:
|
|
43
|
+
height: p,
|
|
44
44
|
utmParams: s,
|
|
45
|
-
syncModulesIds:
|
|
45
|
+
syncModulesIds: l
|
|
46
46
|
});
|
|
47
47
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
@@ -56,7 +56,7 @@ const v = () => {
|
|
|
56
56
|
displayConditions: a,
|
|
57
57
|
ampHtml: i = "",
|
|
58
58
|
ampErrors: o = []
|
|
59
|
-
} = await
|
|
59
|
+
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
61
|
html: e,
|
|
62
62
|
ampHtml: i,
|
|
@@ -64,7 +64,7 @@ const v = () => {
|
|
|
64
64
|
displayConditions: a
|
|
65
65
|
};
|
|
66
66
|
} catch (e) {
|
|
67
|
-
return
|
|
67
|
+
return n(e, "Error loading preview"), {
|
|
68
68
|
html: "",
|
|
69
69
|
ampHtml: "",
|
|
70
70
|
ampErrors: [],
|
|
@@ -80,17 +80,19 @@ const v = () => {
|
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
82
|
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
83
|
-
i ? (
|
|
83
|
+
i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
84
84
|
});
|
|
85
85
|
} catch (i) {
|
|
86
|
-
|
|
86
|
+
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
87
87
|
}
|
|
88
88
|
}),
|
|
89
89
|
updateHtmlAndCss: (t, e) => {
|
|
90
90
|
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
91
91
|
},
|
|
92
92
|
editorSave: () => {
|
|
93
|
-
window.StripoEditorApi.actionsApi.save()
|
|
93
|
+
window.StripoEditorApi.actionsApi.save((t) => {
|
|
94
|
+
t && n(t, "Failed to save template");
|
|
95
|
+
});
|
|
94
96
|
}
|
|
95
97
|
};
|
|
96
98
|
};
|