@useinsider/guido 1.0.3-beta.25c5eb7 → 1.0.3-beta.25d8896
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 +137 -3
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +62 -59
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/composables/useBlocksConfig.js +49 -0
- package/dist/composables/useStripo.js +39 -50
- package/dist/enums/defaults.js +15 -9
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +39 -6
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +4 -4
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +46 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +140 -31
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +60 -60
- package/dist/services/stripoApi.js +1 -1
- package/dist/src/@types/generic.d.ts +41 -6
- package/dist/src/components/Guido.vue.d.ts +2 -2
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +58 -2
- package/dist/src/stores/config.d.ts +7 -1
- package/dist/src/stores/dynamic-content.d.ts +2 -2
- package/dist/src/utils/genericUtil.d.ts +8 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/stores/dynamic-content.js +1 -1
- package/dist/utils/genericUtil.js +32 -8
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -175
- package/dist/extensions/Blocks/controlFactories.js +0 -223
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -43
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -91
package/README.md
CHANGED
|
@@ -82,10 +82,12 @@ export default {
|
|
|
82
82
|
translationsPath: 'window.trans.en',
|
|
83
83
|
htmlCompilerRules: [],
|
|
84
84
|
ignoreDefaultHtmlCompilerRules: false,
|
|
85
|
+
backButtonLabel?: "Back to Design",
|
|
85
86
|
features: {
|
|
86
87
|
dynamicContent: true,
|
|
87
88
|
saveAsTemplate: true,
|
|
88
|
-
versionHistory: true
|
|
89
|
+
versionHistory: true,
|
|
90
|
+
testMessage: true
|
|
89
91
|
}
|
|
90
92
|
},
|
|
91
93
|
dynamicContentModalVisible: false
|
|
@@ -194,6 +196,11 @@ interface GuidoConfig {
|
|
|
194
196
|
dynamicContent: boolean;
|
|
195
197
|
saveAsTemplate: boolean;
|
|
196
198
|
versionHistory: boolean;
|
|
199
|
+
testMessage: boolean;
|
|
200
|
+
};
|
|
201
|
+
blocks?: {
|
|
202
|
+
excludeDefaults?: GuidoBlockType[];
|
|
203
|
+
includeCustoms?: GuidoCustomBlockType[];
|
|
197
204
|
};
|
|
198
205
|
}
|
|
199
206
|
```
|
|
@@ -208,6 +215,9 @@ interface GuidoConfig {
|
|
|
208
215
|
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
209
216
|
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
|
210
217
|
| `features.versionHistory` | `boolean` | `true` | Enable version history feature |
|
|
218
|
+
| `blocks` | `BlocksConfig` | `{ excludeDefaults: [], includeCustoms: [] }` | Block configuration for excluding default blocks and including custom blocks. See [Blocks Configuration](#-blocks-configuration) section below |
|
|
219
|
+
| `blocks.excludeDefaults` | `GuidoBlockType[]` | `[]` | Array of default Stripo blocks to exclude from the editor |
|
|
220
|
+
| `blocks.includeCustoms` | `GuidoCustomBlockType[]` | `[]` | Array of custom blocks to include in the editor |
|
|
211
221
|
|
|
212
222
|
```typescript
|
|
213
223
|
interface DynamicContent {
|
|
@@ -224,6 +234,128 @@ interface DynamicContent {
|
|
|
224
234
|
| `text` | `string` | '' | Visible value of the dynamic content |
|
|
225
235
|
| `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
|
|
226
236
|
|
|
237
|
+
## 🧱 Blocks Configuration
|
|
238
|
+
|
|
239
|
+
Guido allows you to customize which blocks are available in the editor. You can exclude default Stripo blocks and selectively include custom blocks to create tailored editing experiences for different product types.
|
|
240
|
+
|
|
241
|
+
### Block Types
|
|
242
|
+
|
|
243
|
+
#### Default Blocks (GuidoBlockType)
|
|
244
|
+
|
|
245
|
+
These are the standard Stripo email editor blocks that can be excluded:
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
type GuidoBlockType =
|
|
249
|
+
| 'amp-accordion' // AMP accordion component
|
|
250
|
+
| 'amp-carousel' // AMP image carousel
|
|
251
|
+
| 'amp-form-controls' // AMP form elements
|
|
252
|
+
| 'banner-block' // Banner/hero section
|
|
253
|
+
| 'button-block' // Call-to-action buttons
|
|
254
|
+
| 'html-block' // Custom HTML
|
|
255
|
+
| 'image-block' // Image elements
|
|
256
|
+
| 'menu-block' // Navigation menu
|
|
257
|
+
| 'social-block' // Social media links
|
|
258
|
+
| 'spacer-block' // Vertical spacing
|
|
259
|
+
| 'text-block' // Text content
|
|
260
|
+
| 'timer-block' // Countdown timer
|
|
261
|
+
| 'video-block' // Video embeds
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### Custom Blocks (GuidoCustomBlockType)
|
|
265
|
+
|
|
266
|
+
These are custom blocks that can be selectively included:
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
type GuidoCustomBlockType =
|
|
270
|
+
| 'dynamic-content' // Dynamic content merge tags
|
|
271
|
+
| 'checkbox-block' // Checkbox form input
|
|
272
|
+
| 'radio-button-block' // Radio button form input
|
|
273
|
+
| 'recommendation-block' // Product recommendations
|
|
274
|
+
| 'unsubscribe-block' // Unsubscribe link
|
|
275
|
+
| 'coupon-block' // Coupon/promo code
|
|
276
|
+
| 'items-block' // Cart items display
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Configuration Examples
|
|
280
|
+
|
|
281
|
+
#### Example 1: Exclude Specific Default Blocks
|
|
282
|
+
|
|
283
|
+
Disable button, image, and video blocks while keeping all custom blocks:
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
const guidoConfig = {
|
|
287
|
+
translationsPath: 'window.trans.en',
|
|
288
|
+
features: {
|
|
289
|
+
dynamicContent: true,
|
|
290
|
+
saveAsTemplate: true,
|
|
291
|
+
versionHistory: true,
|
|
292
|
+
testMessage: true
|
|
293
|
+
},
|
|
294
|
+
blocks: {
|
|
295
|
+
excludeDefaults: ['button-block', 'image-block', 'video-block']
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Result:**
|
|
301
|
+
- Button, Image, Video blocks disabled
|
|
302
|
+
- All other default blocks enabled
|
|
303
|
+
- All custom blocks are disabled.
|
|
304
|
+
|
|
305
|
+
#### Example 2: Include Only Specific Custom Blocks
|
|
306
|
+
|
|
307
|
+
Enable only coupon and recommendation blocks:
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
const guidoConfig = {
|
|
311
|
+
translationsPath: 'window.trans.en',
|
|
312
|
+
features: {
|
|
313
|
+
dynamicContent: true,
|
|
314
|
+
saveAsTemplate: true,
|
|
315
|
+
versionHistory: true,
|
|
316
|
+
testMessage: true
|
|
317
|
+
},
|
|
318
|
+
blocks: {
|
|
319
|
+
includeCustoms: ['coupon-block', 'recommendation-block']
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**Result:**
|
|
325
|
+
- All default blocks enabled
|
|
326
|
+
- Only Coupon and Recommendation extensions enabled.
|
|
327
|
+
- Other custom blocks are disabled
|
|
328
|
+
|
|
329
|
+
### Default Behavior
|
|
330
|
+
|
|
331
|
+
When `blocks` is not provided or is `undefined`:
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
const guidoConfig = {
|
|
335
|
+
translationsPath: 'window.trans.en',
|
|
336
|
+
features: {
|
|
337
|
+
dynamicContent: true,
|
|
338
|
+
saveAsTemplate: true,
|
|
339
|
+
versionHistory: true,
|
|
340
|
+
testMessage: true
|
|
341
|
+
},
|
|
342
|
+
// No blocks config
|
|
343
|
+
};
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Result:**
|
|
347
|
+
- All 13 default Stripo blocks enabled
|
|
348
|
+
- All custom blocks are disabled.
|
|
349
|
+
|
|
350
|
+
### Block Configuration Interface
|
|
351
|
+
|
|
352
|
+
```typescript
|
|
353
|
+
interface BlocksConfig {
|
|
354
|
+
excludeDefaults?: GuidoBlockType[];
|
|
355
|
+
includeCustoms?: GuidoCustomBlockType[];
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
227
359
|
### TypeScript Types
|
|
228
360
|
|
|
229
361
|
The library exports the following TypeScript types:
|
|
@@ -318,7 +450,8 @@ const guidoConfig = {
|
|
|
318
450
|
features: {
|
|
319
451
|
dynamicContent: true,
|
|
320
452
|
saveAsTemplate: true,
|
|
321
|
-
versionHistory: false // Disable version history
|
|
453
|
+
versionHistory: false, // Disable version history
|
|
454
|
+
testMessage: true
|
|
322
455
|
},
|
|
323
456
|
htmlCompilerRules: [
|
|
324
457
|
{
|
|
@@ -351,7 +484,8 @@ const guidoConfig = {
|
|
|
351
484
|
features: {
|
|
352
485
|
dynamicContent: true,
|
|
353
486
|
saveAsTemplate: true,
|
|
354
|
-
versionHistory: true
|
|
487
|
+
versionHistory: true,
|
|
488
|
+
testMessage: true
|
|
355
489
|
},
|
|
356
490
|
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
357
491
|
htmlCompilerRules: [
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
1
|
+
import { defineComponent as O, defineAsyncComponent as U, ref as z, computed as L, watch as B, onMounted as K, onUnmounted as j } from "vue";
|
|
2
|
+
import { provideGuidoActions as q } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as J } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as Q } from "../composables/useStripo.js";
|
|
5
5
|
import { migrate as W } from "../config/migrator/index.js";
|
|
6
|
-
import { DefaultUsername as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import { useConfigStore as
|
|
15
|
-
import { useDynamicContentStore as
|
|
16
|
-
import { useEditorStore as
|
|
17
|
-
import { usePreviewStore as
|
|
18
|
-
import { useUnsubscribeStore as
|
|
19
|
-
import
|
|
20
|
-
const
|
|
6
|
+
import { DefaultUsername as V, DefaultMessageType as X, DefaultGuidoConfig as Y } from "../enums/defaults.js";
|
|
7
|
+
import Z from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import $ from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
9
|
+
import ee from "./organisms/header/HeaderWrapper.vue.js";
|
|
10
|
+
import oe from "./organisms/LoadingWrapper.vue.js";
|
|
11
|
+
import te from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
12
|
+
import ne from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
13
|
+
import { useStripoApi as re } from "../services/stripoApi.js";
|
|
14
|
+
import { useConfigStore as ie } from "../stores/config.js";
|
|
15
|
+
import { useDynamicContentStore as ae } from "../stores/dynamic-content.js";
|
|
16
|
+
import { useEditorStore as se } from "../stores/editor.js";
|
|
17
|
+
import { usePreviewStore as ce } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as de } from "../stores/unsubscribe.js";
|
|
19
|
+
import me from "../node_modules/lodash-es/merge.js";
|
|
20
|
+
const Le = /* @__PURE__ */ O({
|
|
21
21
|
__name: "Guido",
|
|
22
22
|
props: {
|
|
23
23
|
templateId: null,
|
|
@@ -32,46 +32,46 @@ const Ge = /* @__PURE__ */ R({
|
|
|
32
32
|
templateConfig: null
|
|
33
33
|
},
|
|
34
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished"],
|
|
35
|
-
setup(_, { expose:
|
|
36
|
-
const
|
|
35
|
+
setup(_, { expose: k, emit: t }) {
|
|
36
|
+
const l = _, A = U(
|
|
37
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
38
|
+
), N = U(
|
|
39
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
40
|
+
), p = z(), i = ae(), g = de(), f = ie(), a = se(), F = ce(), n = L(() => a.hasChanges), { getPartnerName: y, getProductType: v, isTestPartner: H } = J(), b = () => {
|
|
41
41
|
var e;
|
|
42
|
-
return (e =
|
|
42
|
+
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
43
43
|
}, {
|
|
44
44
|
templateId: s,
|
|
45
|
-
userId:
|
|
46
|
-
guidoConfig:
|
|
45
|
+
userId: C,
|
|
46
|
+
guidoConfig: h,
|
|
47
47
|
templateConfig: o,
|
|
48
48
|
html: r = "",
|
|
49
|
-
css:
|
|
50
|
-
partnerName: c =
|
|
51
|
-
productType: d =
|
|
52
|
-
messageType:
|
|
53
|
-
username:
|
|
54
|
-
} =
|
|
55
|
-
|
|
49
|
+
css: S = "",
|
|
50
|
+
partnerName: c = y(),
|
|
51
|
+
productType: d = v(),
|
|
52
|
+
messageType: w = X,
|
|
53
|
+
username: D = V
|
|
54
|
+
} = l, m = (o == null ? void 0 : o.preselectedDynamicContentList) || [];
|
|
55
|
+
a.templateId = s, window.GuidoConfig = me(Y, h), window.GuidoConfig.partner = {
|
|
56
56
|
partnerName: c,
|
|
57
57
|
productType: d,
|
|
58
|
-
messageType:
|
|
59
|
-
},
|
|
60
|
-
const { initPlugin:
|
|
58
|
+
messageType: w
|
|
59
|
+
}, f.templateConfig = o;
|
|
60
|
+
const { initPlugin: E } = Q({
|
|
61
61
|
emailId: s,
|
|
62
|
-
userId:
|
|
63
|
-
username:
|
|
62
|
+
userId: C,
|
|
63
|
+
username: D,
|
|
64
64
|
partnerName: c,
|
|
65
65
|
productType: d,
|
|
66
66
|
preselectedDynamicContentList: m,
|
|
67
67
|
onReady: () => {
|
|
68
68
|
console.debug("guido:ready"), t("ready");
|
|
69
69
|
}
|
|
70
|
-
}), { getDefaultTemplate: T } =
|
|
70
|
+
}), { getDefaultTemplate: T } = re(), R = L(() => {
|
|
71
71
|
var e;
|
|
72
72
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
q({
|
|
75
75
|
onBack: () => {
|
|
76
76
|
console.debug("guido:back"), t("back");
|
|
77
77
|
},
|
|
@@ -82,47 +82,50 @@ const Ge = /* @__PURE__ */ R({
|
|
|
82
82
|
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:close", e),
|
|
87
|
-
},
|
|
85
|
+
const P = (e) => {
|
|
86
|
+
console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
87
|
+
}, G = () => {
|
|
88
88
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
B(() => n.value, () => {
|
|
91
91
|
t("on-change", n.value);
|
|
92
|
-
})
|
|
92
|
+
});
|
|
93
|
+
const u = (e) => {
|
|
94
|
+
const I = e, { attribute: x, position: M } = I.detail;
|
|
95
|
+
console.debug("dynamic-content:open", I.detail), t("dynamic-content:open", x, M);
|
|
96
|
+
};
|
|
97
|
+
return K(async () => {
|
|
93
98
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
94
99
|
try {
|
|
95
|
-
|
|
100
|
+
g.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
96
101
|
let e = {
|
|
97
102
|
html: r && await W(r),
|
|
98
|
-
css:
|
|
103
|
+
css: S,
|
|
99
104
|
forceRecreate: !0
|
|
100
105
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
101
106
|
};
|
|
102
|
-
e.html || (e = await T(), e.html = await W(e.html)), await
|
|
107
|
+
e.html || (e = await T(), e.html = await W(e.html)), await E(e), i.selectedDynamicContentList = m;
|
|
103
108
|
} catch (e) {
|
|
104
109
|
console.error("Failed to initialize Stripo editor:", e);
|
|
105
110
|
}
|
|
106
|
-
document.addEventListener("dynamic-content:open",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
}), B(() => {
|
|
111
|
+
document.addEventListener("dynamic-content:open", u);
|
|
112
|
+
}), j(() => {
|
|
113
|
+
document.removeEventListener("dynamic-content:open", u);
|
|
111
114
|
try {
|
|
112
115
|
window.UIEditor.removeEditor();
|
|
113
116
|
} catch {
|
|
114
117
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
115
118
|
}
|
|
116
|
-
}),
|
|
119
|
+
}), k({
|
|
117
120
|
dynamicContent: {
|
|
118
|
-
insert:
|
|
119
|
-
close:
|
|
121
|
+
insert: P,
|
|
122
|
+
close: G
|
|
120
123
|
},
|
|
121
124
|
hasChanges: n,
|
|
122
|
-
saveSilent:
|
|
123
|
-
}), { __sfc: !0, PreviewContainer:
|
|
125
|
+
saveSilent: b
|
|
126
|
+
}), { __sfc: !0, PreviewContainer: A, OnboardingWrapper: N, headerWrapperRef: p, dynamicContentStore: i, unsubscribeStore: g, props: l, configStore: f, editorStore: a, previewStore: F, hasChanges: n, getPartnerName: y, getProductType: v, isTestPartner: H, saveSilent: b, templateId: s, userId: C, guidoConfig: h, templateConfig: o, html: r, css: S, partnerName: c, productType: d, messageType: w, username: D, preselectedDynamicContentList: m, emit: t, initPlugin: E, getDefaultTemplate: T, noHeader: R, insertDynamicContent: P, closeDynamicContent: G, handleDynamicContentOpen: u, Toaster: Z, FilterSelectionDrawer: $, HeaderWrapper: ee, LoadingWrapper: oe, SaveAsTemplateDrawer: te, UnsubscribeWrapper: ne };
|
|
124
127
|
}
|
|
125
128
|
});
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
Le as default
|
|
128
131
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as c, computed as a } from "vue";
|
|
2
|
+
import { useConfig as m } from "../../../composables/useConfig.js";
|
|
3
|
+
import { useBack as u } from "../../../composables/useGuidoActions.js";
|
|
4
|
+
import { usePreviewMode as f } from "../../../composables/usePreviewMode.js";
|
|
4
5
|
import { useTranslations as p } from "../../../composables/useTranslations.js";
|
|
5
|
-
import { useVersionHistoryApi as
|
|
6
|
-
import { useEditorStore as
|
|
7
|
-
import { InButtonV2 as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
6
|
+
import { useVersionHistoryApi as d } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
+
import { useEditorStore as l } from "../../../stores/editor.js";
|
|
8
|
+
import { InButtonV2 as k } from "@useinsider/design-system-vue";
|
|
9
|
+
import B from "./version-history/RestoreButton.vue.js";
|
|
10
|
+
const P = /* @__PURE__ */ c({
|
|
10
11
|
__name: "LeftSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const o =
|
|
13
|
-
return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory:
|
|
12
|
+
setup(b) {
|
|
13
|
+
const o = l(), r = u(), { closeVersionHistory: i } = d(), { closePreviewMode: n } = f(), e = p(), { config: t } = m(), s = a(() => o.isVersionHistoryOpen || o.isPreviewModeOpen ? e("email-editor.back-to-editor") : t.backButtonLabel ? t.backButtonLabel : e("email-editor.back-to-design"));
|
|
14
|
+
return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: i, closePreviewMode: n, trans: e, config: t, backButtonLabel: s, handleBackClick: () => {
|
|
14
15
|
if (o.isVersionHistoryOpen) {
|
|
15
|
-
|
|
16
|
+
i();
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
19
|
if (o.isPreviewModeOpen) {
|
|
19
|
-
|
|
20
|
+
n();
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
r();
|
|
23
|
-
}, InButtonV2:
|
|
24
|
+
}, InButtonV2: k, RestoreButton: B };
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
P as default
|
|
28
29
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [(
|
|
1
|
+
import a from "./RightSlot.vue2.js";
|
|
2
|
+
import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var r = function() {
|
|
4
|
+
var o, i, n;
|
|
5
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? 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 } }) : s._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 = t.config.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 } }) : s._e(), (n = t.config.features) != null && n.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"), "tooltip-text": t.trans("newsletter.test-email") } }) : s._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(_) {
|
|
7
7
|
return t.handleSave(!1);
|
|
8
8
|
} } })], 1);
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
l,
|
|
9
|
+
}, u = [], d = /* @__PURE__ */ l(
|
|
10
|
+
a,
|
|
12
11
|
r,
|
|
12
|
+
u,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
15
|
null
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const f = d.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as default
|
|
20
20
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const l = {
|
|
2
|
+
"amp-accordion": "ampAccordionEnabled",
|
|
3
|
+
"amp-carousel": "ampCarouselEnabled",
|
|
4
|
+
"amp-form-controls": "ampFormControlsEnabled",
|
|
5
|
+
"banner-block": "bannerEnabled",
|
|
6
|
+
"button-block": "buttonEnabled",
|
|
7
|
+
"html-block": "htmlEnabled",
|
|
8
|
+
"image-block": "imageEnabled",
|
|
9
|
+
"menu-block": "menuEnabled",
|
|
10
|
+
"social-block": "socialNetEnabled",
|
|
11
|
+
"spacer-block": "spacerEnabled",
|
|
12
|
+
"text-block": "textEnabled",
|
|
13
|
+
"timer-block": "timerEnabled",
|
|
14
|
+
"video-block": "videoEnabled"
|
|
15
|
+
}, c = {
|
|
16
|
+
"dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
|
|
17
|
+
"checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
|
|
18
|
+
"radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
|
|
19
|
+
"recommendation-block": () => import("../extensions/Blocks/Recommendation/extension.js"),
|
|
20
|
+
"unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
|
|
21
|
+
"coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
|
|
22
|
+
"items-block": null
|
|
23
|
+
// TODO: Add ItemsBlock extension when available
|
|
24
|
+
}, a = (n) => {
|
|
25
|
+
if (!n || !n.length)
|
|
26
|
+
return {};
|
|
27
|
+
const o = {};
|
|
28
|
+
return n.forEach((e) => {
|
|
29
|
+
const t = l[e];
|
|
30
|
+
t && (o[t] = !1);
|
|
31
|
+
}), o;
|
|
32
|
+
}, r = async (n) => !n || !n.length ? [] : (await Promise.all(
|
|
33
|
+
n.map(async (e) => {
|
|
34
|
+
const t = c[e];
|
|
35
|
+
return t ? (await t()).default : null;
|
|
36
|
+
})
|
|
37
|
+
)).filter((e) => e !== null), s = () => ({
|
|
38
|
+
getStripoBlocksConfig: async () => {
|
|
39
|
+
var e;
|
|
40
|
+
const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
|
|
41
|
+
return {
|
|
42
|
+
baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
|
|
43
|
+
extensions: await r(o == null ? void 0 : o.includeCustoms)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
s as useBlocksConfig
|
|
49
|
+
};
|