@useinsider/guido 3.2.0-beta.e01b42a → 3.2.0-beta.ec6228c
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 +24 -0
- package/dist/@types/config/schemas.js +82 -68
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +92 -81
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useActionsApi.js +4 -4
- package/dist/composables/useAutoSave.js +68 -0
- package/dist/composables/useFullStoryBridge.js +14 -0
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +52 -47
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +52 -46
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/recommendation.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +94 -92
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +32 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +14 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +6 -0
- package/dist/src/stores/config.d.ts +126 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/static/styles/base.css.js +7 -2
- package/dist/static/styles/components/button.css.js +3 -2
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/stores/autosave.js +11 -0
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/timeUtil.js +19 -0
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -143,6 +143,8 @@ const config: GuidoConfigInput = {
|
|
|
143
143
|
displayConditions?: boolean, // Default: true
|
|
144
144
|
unsubscribe?: boolean, // Default: true
|
|
145
145
|
modulesDisabled?: boolean, // Default: false - Disable modules panel
|
|
146
|
+
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
147
|
+
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
146
148
|
},
|
|
147
149
|
|
|
148
150
|
// Optional: Callbacks
|
|
@@ -326,6 +328,28 @@ const config: GuidoConfigInput = {
|
|
|
326
328
|
|
|
327
329
|
---
|
|
328
330
|
|
|
331
|
+
## Autosave
|
|
332
|
+
|
|
333
|
+
Guido ships an opt-in **autosave** that saves on a 2-minute interval and when the user leaves the tab. Enable it with the `features.autosave` feature flag — this **shows an "Auto Save" toggle in the editor header**; the end user switches autosave on per session.
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
const config: GuidoConfigInput = {
|
|
337
|
+
identity: { templateId: 'tpl-123', userId: 'user-456' },
|
|
338
|
+
partner: { name: 'partner' },
|
|
339
|
+
features: {
|
|
340
|
+
autosave: true, // Default: false — shows the Auto Save toggle in the header
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
- Default is `false` — integrations see no change unless they opt in.
|
|
346
|
+
- Autosave reuses the same save pipeline as the Save button, so your existing `@save:complete` handler receives autosave output identically to a manual save. No new events or callbacks.
|
|
347
|
+
- Toggle state is **session-only** (Pinia) — resets to OFF on reload.
|
|
348
|
+
|
|
349
|
+
For a deep dive on triggers, guards, and limitations, see **[wiki/AUTOSAVE.md](wiki/AUTOSAVE.md)**.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
329
353
|
## HTML Compiler Rules
|
|
330
354
|
|
|
331
355
|
Add custom rules to transform HTML during export:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
|
|
2
|
-
import { object as
|
|
2
|
+
import { object as a, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as o, array as c, literal as l, variant as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const m = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -12,7 +12,7 @@ const m = {
|
|
|
12
12
|
ARCHITECT: 49,
|
|
13
13
|
/** Unsubscribe page builder */
|
|
14
14
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
}, h =
|
|
15
|
+
}, h = a({
|
|
16
16
|
/** Unique identifier for the template being edited */
|
|
17
17
|
templateId: u(
|
|
18
18
|
t(),
|
|
@@ -25,7 +25,12 @@ const m = {
|
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
27
|
variationId: e(t())
|
|
28
|
-
}),
|
|
28
|
+
}), f = a({
|
|
29
|
+
/** Fallback font name (e.g., "Georgia") */
|
|
30
|
+
name: t(),
|
|
31
|
+
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
32
|
+
family: t()
|
|
33
|
+
}), y = a({
|
|
29
34
|
/** Partner/organization name (required) */
|
|
30
35
|
name: u(
|
|
31
36
|
t(),
|
|
@@ -46,8 +51,10 @@ const m = {
|
|
|
46
51
|
m.PROMOTIONAL
|
|
47
52
|
),
|
|
48
53
|
/** Display name for the current user */
|
|
49
|
-
username: e(t(), "Guido User")
|
|
50
|
-
|
|
54
|
+
username: e(t(), "Guido User"),
|
|
55
|
+
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
56
|
+
fallbackFont: e(f)
|
|
57
|
+
}), A = a({
|
|
51
58
|
/** Display text for the dynamic content */
|
|
52
59
|
text: t(),
|
|
53
60
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -56,31 +63,33 @@ const m = {
|
|
|
56
63
|
fallback: e(t()),
|
|
57
64
|
/** Optional formatting options */
|
|
58
65
|
format: e(
|
|
59
|
-
|
|
66
|
+
a({
|
|
60
67
|
key: t(),
|
|
61
68
|
value: t()
|
|
62
69
|
})
|
|
63
70
|
)
|
|
64
|
-
}), R =
|
|
71
|
+
}), R = a({
|
|
65
72
|
/** Initial HTML content */
|
|
66
73
|
html: e(t(), ""),
|
|
67
74
|
/** Initial CSS content */
|
|
68
75
|
css: e(t(), ""),
|
|
69
76
|
/** Preselected dynamic content items */
|
|
70
77
|
preselectedDynamicContent: e(
|
|
71
|
-
c(
|
|
78
|
+
c(A),
|
|
72
79
|
[]
|
|
73
80
|
),
|
|
81
|
+
/** Valid custom field attribute names from the partner's categorized fields */
|
|
82
|
+
customFieldAttributes: e(c(t()), []),
|
|
74
83
|
/** Selected unsubscribe page IDs */
|
|
75
84
|
selectedUnsubscribePages: e(c(p()), []),
|
|
76
85
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
77
|
-
forceRecreate: e(
|
|
78
|
-
}),
|
|
86
|
+
forceRecreate: e(o(), !1)
|
|
87
|
+
}), C = a({
|
|
79
88
|
/** Sender display name */
|
|
80
89
|
senderName: e(t(), ""),
|
|
81
90
|
/** Email subject line */
|
|
82
91
|
subject: e(t(), "")
|
|
83
|
-
}),
|
|
92
|
+
}), T = a({
|
|
84
93
|
/** Locale for the editor UI */
|
|
85
94
|
locale: e(t(), "en"),
|
|
86
95
|
/** Path to translations object */
|
|
@@ -88,32 +97,36 @@ const m = {
|
|
|
88
97
|
/** Migration date for template compatibility */
|
|
89
98
|
migrationDate: e(p(), 1759696858),
|
|
90
99
|
/** Email header settings */
|
|
91
|
-
emailHeader: e(
|
|
100
|
+
emailHeader: e(C, { senderName: "", subject: "" }),
|
|
92
101
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
93
102
|
savedModulesFolderName: e(t(), b.SAVED_MODULES),
|
|
94
103
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
95
104
|
defaultModulesFolderName: e(t(), b.DEFAULT_MODULES)
|
|
96
|
-
}),
|
|
105
|
+
}), I = a({
|
|
97
106
|
/** Whether to show the header bar */
|
|
98
|
-
showHeader: e(
|
|
107
|
+
showHeader: e(o(), !0),
|
|
99
108
|
/** Custom label for back button (if shown) */
|
|
100
109
|
backButtonLabel: e(t())
|
|
101
|
-
}),
|
|
110
|
+
}), E = a({
|
|
102
111
|
/** Enable dynamic content insertion */
|
|
103
|
-
dynamicContent: e(
|
|
112
|
+
dynamicContent: e(o(), !0),
|
|
104
113
|
/** Enable save as template functionality */
|
|
105
|
-
saveAsTemplate: e(
|
|
114
|
+
saveAsTemplate: e(o(), !0),
|
|
106
115
|
/** Enable version history */
|
|
107
|
-
versionHistory: e(
|
|
116
|
+
versionHistory: e(o(), !0),
|
|
108
117
|
/** Enable test message sending */
|
|
109
|
-
testMessage: e(
|
|
118
|
+
testMessage: e(o(), !0),
|
|
110
119
|
/** Enable display conditions */
|
|
111
|
-
displayConditions: e(
|
|
120
|
+
displayConditions: e(o(), !0),
|
|
112
121
|
/** Enable unsubscribe block */
|
|
113
|
-
unsubscribe: e(
|
|
122
|
+
unsubscribe: e(o(), !0),
|
|
114
123
|
/** Disable modules panel in the editor */
|
|
115
|
-
modulesDisabled: e(
|
|
116
|
-
|
|
124
|
+
modulesDisabled: e(o(), !1),
|
|
125
|
+
/** Enable Liquid template syntax */
|
|
126
|
+
liquidSyntax: e(o(), !1),
|
|
127
|
+
/** Enable autosave (2-min interval + tab-hide). User toggles on/off from the header. */
|
|
128
|
+
autosave: e(o(), !1)
|
|
129
|
+
}), g = n([
|
|
117
130
|
"amp-accordion",
|
|
118
131
|
"amp-carousel",
|
|
119
132
|
"amp-form-controls",
|
|
@@ -127,7 +140,7 @@ const m = {
|
|
|
127
140
|
"text-block",
|
|
128
141
|
"timer-block",
|
|
129
142
|
"video-block"
|
|
130
|
-
]),
|
|
143
|
+
]), O = n([
|
|
131
144
|
"dynamic-content",
|
|
132
145
|
"checkbox-block",
|
|
133
146
|
"radio-button-block",
|
|
@@ -135,66 +148,66 @@ const m = {
|
|
|
135
148
|
"unsubscribe-block",
|
|
136
149
|
"coupon-block",
|
|
137
150
|
"items-block"
|
|
138
|
-
]),
|
|
151
|
+
]), L = a({
|
|
139
152
|
/** Default blocks to exclude from the editor */
|
|
140
153
|
excludeDefaults: e(
|
|
141
|
-
c(
|
|
154
|
+
c(g),
|
|
142
155
|
[]
|
|
143
156
|
),
|
|
144
157
|
/** Custom blocks to include in the editor */
|
|
145
158
|
includeCustoms: e(
|
|
146
|
-
c(
|
|
159
|
+
c(O),
|
|
147
160
|
[]
|
|
148
161
|
)
|
|
149
|
-
}),
|
|
162
|
+
}), r = a({
|
|
150
163
|
/** Unique identifier for the rule */
|
|
151
164
|
id: t(),
|
|
152
165
|
/** Human-readable description */
|
|
153
166
|
description: e(t()),
|
|
154
167
|
/** Priority for rule ordering (lower = earlier) */
|
|
155
168
|
priority: p()
|
|
156
|
-
}),
|
|
157
|
-
...
|
|
158
|
-
type:
|
|
169
|
+
}), M = a({
|
|
170
|
+
...r.entries,
|
|
171
|
+
type: l("replace"),
|
|
159
172
|
/** String to search for */
|
|
160
173
|
search: t(),
|
|
161
174
|
/** Replacement string */
|
|
162
175
|
replacement: t(),
|
|
163
176
|
/** Replace all occurrences (default: false) */
|
|
164
|
-
replaceAll: e(
|
|
165
|
-
}),
|
|
166
|
-
...
|
|
167
|
-
type:
|
|
177
|
+
replaceAll: e(o())
|
|
178
|
+
}), N = a({
|
|
179
|
+
...r.entries,
|
|
180
|
+
type: l("regex"),
|
|
168
181
|
/** Regex pattern string */
|
|
169
182
|
pattern: t(),
|
|
170
183
|
/** Replacement string (supports $1, $2, etc.) */
|
|
171
184
|
replacement: t(),
|
|
172
185
|
/** Regex flags (e.g., 'gi') */
|
|
173
186
|
flags: e(t())
|
|
174
|
-
}),
|
|
175
|
-
...
|
|
176
|
-
type:
|
|
187
|
+
}), D = a({
|
|
188
|
+
...r.entries,
|
|
189
|
+
type: l("remove"),
|
|
177
190
|
/** Strings or patterns to remove */
|
|
178
191
|
targets: c(t())
|
|
179
|
-
}),
|
|
180
|
-
...
|
|
181
|
-
type:
|
|
192
|
+
}), v = a({
|
|
193
|
+
...r.entries,
|
|
194
|
+
type: l("custom"),
|
|
182
195
|
/** Custom processor function */
|
|
183
196
|
processor: S(
|
|
184
197
|
(i) => typeof i == "function",
|
|
185
198
|
"processor must be a function"
|
|
186
199
|
)
|
|
187
|
-
}),
|
|
188
|
-
L,
|
|
200
|
+
}), x = k("type", [
|
|
189
201
|
M,
|
|
190
202
|
N,
|
|
191
|
-
D
|
|
192
|
-
|
|
203
|
+
D,
|
|
204
|
+
v
|
|
205
|
+
]), U = a({
|
|
193
206
|
/** Custom compiler rules to apply */
|
|
194
|
-
customRules: e(c(
|
|
207
|
+
customRules: e(c(x), []),
|
|
195
208
|
/** Skip default compiler rules */
|
|
196
|
-
ignoreDefaultRules: e(
|
|
197
|
-
}),
|
|
209
|
+
ignoreDefaultRules: e(o(), !1)
|
|
210
|
+
}), B = a({
|
|
198
211
|
/**
|
|
199
212
|
* External validation handler called before save completes.
|
|
200
213
|
* Return false to cancel the save operation.
|
|
@@ -205,7 +218,7 @@ const m = {
|
|
|
205
218
|
"externalValidation must be a function"
|
|
206
219
|
)
|
|
207
220
|
)
|
|
208
|
-
}), H =
|
|
221
|
+
}), H = a({
|
|
209
222
|
// Required sections
|
|
210
223
|
/** Identity configuration (required) */
|
|
211
224
|
identity: h,
|
|
@@ -215,38 +228,39 @@ const m = {
|
|
|
215
228
|
/** Template content and presets */
|
|
216
229
|
template: e(R, {}),
|
|
217
230
|
/** Editor settings */
|
|
218
|
-
editor: e(
|
|
231
|
+
editor: e(T, {}),
|
|
219
232
|
/** UI configuration */
|
|
220
|
-
ui: e(
|
|
233
|
+
ui: e(I, {}),
|
|
221
234
|
/** Feature toggles */
|
|
222
|
-
features: e(
|
|
235
|
+
features: e(E, {}),
|
|
223
236
|
/** Block configuration */
|
|
224
|
-
blocks: e(
|
|
237
|
+
blocks: e(L, {}),
|
|
225
238
|
/** Compiler configuration */
|
|
226
239
|
compiler: e(U, {}),
|
|
227
240
|
/** Callbacks and event handlers */
|
|
228
|
-
callbacks: e(
|
|
241
|
+
callbacks: e(B, {})
|
|
229
242
|
});
|
|
230
243
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
L as BlocksSchema,
|
|
245
|
+
B as CallbacksSchema,
|
|
246
|
+
x as CompilerRuleSchema,
|
|
234
247
|
U as CompilerSchema,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
248
|
+
O as CustomBlockTypeSchema,
|
|
249
|
+
v as CustomRuleSchema,
|
|
250
|
+
g as DefaultBlockTypeSchema,
|
|
251
|
+
A as DynamicContentSchema,
|
|
252
|
+
T as EditorSchema,
|
|
253
|
+
C as EmailHeaderSchema,
|
|
254
|
+
f as FallbackFontSchema,
|
|
255
|
+
E as FeaturesSchema,
|
|
242
256
|
H as GuidoConfigSchema,
|
|
243
257
|
h as IdentitySchema,
|
|
244
258
|
m as MessageType,
|
|
245
259
|
y as PartnerSchema,
|
|
246
260
|
s as ProductType,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
261
|
+
N as RegexRuleSchema,
|
|
262
|
+
D as RemoveRuleSchema,
|
|
263
|
+
M as ReplaceRuleSchema,
|
|
250
264
|
R as TemplateSchema,
|
|
251
|
-
|
|
265
|
+
I as UISchema
|
|
252
266
|
};
|
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
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", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), 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(
|
|
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
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"fffc13d6"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const l = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
l as default
|
|
20
20
|
};
|
|
@@ -1,121 +1,132 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
1
|
+
import { defineComponent as j, defineAsyncComponent as N, ref as R, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
|
+
import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as Z } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as ee } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as te } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as B } from "../enums/defaults.js";
|
|
8
|
+
import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
|
|
9
|
+
import ne from "./organisms/AutoSaveController.vue.js";
|
|
10
|
+
import re from "./organisms/base/Toaster.vue.js";
|
|
11
|
+
import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
12
|
+
import ce from "./organisms/header/HeaderWrapper.vue.js";
|
|
13
|
+
import ae from "./organisms/LoadingWrapper.vue.js";
|
|
14
|
+
import ie from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
15
|
+
import me from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
16
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
17
|
+
import { useConfigStore as le } from "../stores/config.js";
|
|
18
|
+
import { useDynamicContentStore as ue } from "../stores/dynamic-content.js";
|
|
19
|
+
import { useEditorStore as pe } from "../stores/editor.js";
|
|
20
|
+
import { usePreviewStore as fe } from "../stores/preview.js";
|
|
21
|
+
import { useUnsubscribeStore as ve } from "../stores/unsubscribe.js";
|
|
22
|
+
const Ie = /* @__PURE__ */ j({
|
|
21
23
|
__name: "Guido",
|
|
22
24
|
props: {
|
|
23
25
|
config: null
|
|
24
26
|
},
|
|
25
27
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
28
|
+
setup(H, { expose: x, emit: r }) {
|
|
29
|
+
const S = H, G = N(
|
|
28
30
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
31
|
+
), z = N(
|
|
30
32
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
const
|
|
33
|
+
), b = R(), d = R(), l = ue(), g = ve(), a = le();
|
|
34
|
+
a.init(S.config);
|
|
35
|
+
const u = pe(), q = fe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
|
|
34
36
|
var e;
|
|
35
|
-
return (e =
|
|
37
|
+
return (e = b.value) == null ? void 0 : e.handleSave(!0);
|
|
36
38
|
}, {
|
|
37
|
-
templateId:
|
|
38
|
-
userId:
|
|
39
|
-
partnerName:
|
|
40
|
-
username:
|
|
41
|
-
template:
|
|
42
|
-
editor:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
emailId:
|
|
47
|
-
userId:
|
|
48
|
-
username:
|
|
49
|
-
partnerName:
|
|
50
|
-
savedModulesFolderName:
|
|
51
|
-
defaultModulesFolderName:
|
|
52
|
-
},
|
|
53
|
-
preselectedDynamicContentList:
|
|
39
|
+
templateId: p,
|
|
40
|
+
userId: E,
|
|
41
|
+
partnerName: D,
|
|
42
|
+
username: C,
|
|
43
|
+
template: t,
|
|
44
|
+
editor: s
|
|
45
|
+
} = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (s == null ? void 0 : s.savedModulesFolderName) || B.SAVED_MODULES, F = (s == null ? void 0 : s.defaultModulesFolderName) || B.DEFAULT_MODULES;
|
|
46
|
+
u.templateId = p;
|
|
47
|
+
const v = {
|
|
48
|
+
emailId: p,
|
|
49
|
+
userId: E,
|
|
50
|
+
username: C,
|
|
51
|
+
partnerName: D,
|
|
52
|
+
savedModulesFolderName: k,
|
|
53
|
+
defaultModulesFolderName: F
|
|
54
|
+
}, L = {
|
|
55
|
+
preselectedDynamicContentList: f,
|
|
54
56
|
onReady: () => {
|
|
55
|
-
console.debug("guido:ready"),
|
|
57
|
+
console.debug("guido:ready"), r("ready");
|
|
56
58
|
}
|
|
57
|
-
}, { initPlugin:
|
|
59
|
+
}, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = de(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
|
|
58
60
|
var e;
|
|
59
|
-
return !((e =
|
|
61
|
+
return !((e = a.ui) != null && e.showHeader);
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
Y({
|
|
62
64
|
onBack: () => {
|
|
63
|
-
console.debug("guido:back"),
|
|
65
|
+
console.debug("guido:back"), r("back");
|
|
64
66
|
},
|
|
65
67
|
onSaveStart: () => {
|
|
66
|
-
console.debug("guido:save:start"),
|
|
68
|
+
console.debug("guido:save:start"), r("save:start");
|
|
67
69
|
},
|
|
68
70
|
onSaveComplete: (e) => {
|
|
69
|
-
const
|
|
70
|
-
console.debug("guido:save:complete",
|
|
71
|
+
const n = { ...e, metadata: v };
|
|
72
|
+
console.debug("guido:save:complete", n), r("save:complete", n);
|
|
71
73
|
},
|
|
72
74
|
onTestEmailClick: () => {
|
|
73
|
-
console.debug("guido:test-email:click"),
|
|
75
|
+
console.debug("guido:test-email:click"), r("test-email:click");
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
|
-
const
|
|
77
|
-
console.debug("dynamic-content:close", e),
|
|
78
|
-
},
|
|
78
|
+
const P = (e) => {
|
|
79
|
+
console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
80
|
+
}, A = () => {
|
|
79
81
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
80
82
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
J(() => i.value, () => {
|
|
84
|
+
r("on-change", i.value);
|
|
83
85
|
});
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:open",
|
|
86
|
+
const y = (e) => {
|
|
87
|
+
const n = e, { attribute: o, position: $ } = n.detail;
|
|
88
|
+
console.debug("dynamic-content:open", n.detail), r("dynamic-content:open", o, $);
|
|
87
89
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
let c = null;
|
|
91
|
+
const h = () => {
|
|
92
|
+
var n;
|
|
93
|
+
const e = document.querySelector(oe);
|
|
94
|
+
(n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
95
|
+
};
|
|
96
|
+
return Q(async () => {
|
|
97
|
+
var n;
|
|
98
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
|
|
99
|
+
const e = (n = d.value) == null ? void 0 : n.parentElement;
|
|
100
|
+
e && (c = new ResizeObserver(h), c.observe(e));
|
|
90
101
|
try {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
html:
|
|
94
|
-
css:
|
|
102
|
+
g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
103
|
+
let o = {
|
|
104
|
+
html: m && await W(m),
|
|
105
|
+
css: T
|
|
95
106
|
};
|
|
96
|
-
|
|
97
|
-
} catch (
|
|
98
|
-
console.error("Failed to initialize Stripo editor:",
|
|
107
|
+
o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
|
|
108
|
+
} catch (o) {
|
|
109
|
+
console.error("Failed to initialize Stripo editor:", o);
|
|
99
110
|
}
|
|
100
|
-
document.addEventListener("dynamic-content:open",
|
|
101
|
-
}),
|
|
102
|
-
document.removeEventListener("dynamic-content:open",
|
|
111
|
+
document.addEventListener("dynamic-content:open", y);
|
|
112
|
+
}), X(() => {
|
|
113
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
|
|
103
114
|
try {
|
|
104
115
|
window.UIEditor.removeEditor();
|
|
105
116
|
} catch {
|
|
106
117
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
107
118
|
}
|
|
108
|
-
|
|
109
|
-
}),
|
|
119
|
+
a.reset();
|
|
120
|
+
}), x({
|
|
110
121
|
dynamicContent: {
|
|
111
|
-
insert:
|
|
112
|
-
close:
|
|
122
|
+
insert: P,
|
|
123
|
+
close: A
|
|
113
124
|
},
|
|
114
|
-
hasChanges:
|
|
115
|
-
saveSilent:
|
|
116
|
-
}), { __sfc: !0, PreviewContainer:
|
|
125
|
+
hasChanges: i,
|
|
126
|
+
saveSilent: w
|
|
127
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: b, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: S, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: s, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: r, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: A, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, AutoSaveController: ne, Toaster: re, FilterSelectionDrawer: se, HeaderWrapper: ce, LoadingWrapper: ae, SaveAsTemplateDrawer: ie, UnsubscribeWrapper: me };
|
|
117
128
|
}
|
|
118
129
|
});
|
|
119
130
|
export {
|
|
120
|
-
|
|
131
|
+
Ie as default
|
|
121
132
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import n from "./AutoSaveController.vue2.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var o = function() {
|
|
4
|
+
var r = this, e = r._self._c;
|
|
5
|
+
return r._self._setupProxy, e("div", { staticClass: "d-n" });
|
|
6
|
+
}, s = [], _ = /* @__PURE__ */ t(
|
|
7
|
+
n,
|
|
8
|
+
o,
|
|
9
|
+
s,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const f = _.exports;
|
|
15
|
+
export {
|
|
16
|
+
f as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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({
|
|
5
|
+
__name: "AutoSaveController",
|
|
6
|
+
setup(a) {
|
|
7
|
+
const { save: e } = s(), o = () => e(!1);
|
|
8
|
+
return r(o), { __sfc: !0, save: e, backgroundSave: o };
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
f as default
|
|
13
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import s from "./EmailSizeIndicator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return
|
|
7
|
-
}, a = [], n = /* @__PURE__ */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var i = this, e = i._self._c, t = i._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "d-f a-i-c j-c-c" }, [t.previewStore.isLoaded ? [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })] : e(t.InSkeleton, { attrs: { sizing: { width: 200, height: 20 } } })], 2);
|
|
7
|
+
}, a = [], n = /* @__PURE__ */ o(
|
|
8
8
|
s,
|
|
9
|
-
|
|
9
|
+
r,
|
|
10
10
|
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"2cb418af"
|
|
14
14
|
);
|
|
15
15
|
const m = n.exports;
|
|
16
16
|
export {
|