@useinsider/guido 1.0.3-beta.729420c → 1.0.3-beta.734efde
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 +169 -3
- 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 +48 -0
- package/dist/composables/useStripo.js +40 -51
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/recommendationMigrator.js +293 -0
- package/dist/enums/defaults.js +15 -9
- package/dist/enums/extensions/recommendationBlock.js +2 -2
- package/dist/extensions/Blocks/Checkbox/block.js +5 -2
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Items/block.js +66 -0
- package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +99 -0
- package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
- package/dist/extensions/Blocks/Items/controls/index.js +217 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +280 -0
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
- package/dist/extensions/Blocks/Items/enums/productEnums.js +195 -0
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +70 -0
- package/dist/extensions/Blocks/Items/extension.js +19 -0
- package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
- package/dist/extensions/Blocks/Items/items.css.js +23 -0
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +61 -0
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
- package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
- package/dist/extensions/Blocks/Items/template.js +110 -0
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
- package/dist/extensions/Blocks/RadioButton/block.js +5 -2
- package/dist/extensions/Blocks/Recommendation/block.js +6 -3
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +69 -40
- 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 +42 -7
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +107 -22
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
- package/dist/extensions/Blocks/common-control.js +201 -55
- package/dist/extensions/Blocks/controlFactories.js +223 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +353 -101
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +13 -19
- package/dist/services/stripoApi.js +1 -1
- package/dist/src/@types/generic.d.ts +9 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +13 -0
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +154 -0
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +43 -0
- package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
- package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +6 -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/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +65 -7
- package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
- package/dist/src/stores/config.d.ts +6 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- package/dist/utils/genericUtil.js +7 -8
- package/package.json +11 -4
- package/dist/extensions/Blocks/Recommendation/template.js +0 -200
- package/dist/src/extensions/Blocks/Recommendation/template.d.ts +0 -6
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: [
|
|
@@ -650,3 +784,35 @@ ISC License
|
|
|
650
784
|
- Playwright integrationBoilerplate/control.ts
|
|
651
785
|
- Commitlint & Precommit Hooks integration
|
|
652
786
|
- Get Pre-built display conditions from API
|
|
787
|
+
|
|
788
|
+
Recommendation Block:
|
|
789
|
+
- [ ] Validations for Filters
|
|
790
|
+
- [ ] DOM Rerender after Filters change
|
|
791
|
+
- [ ] Change currencySymbol as Input Type
|
|
792
|
+
- [ ] Apply filter query to request
|
|
793
|
+
- [ ] Drawer loading bug
|
|
794
|
+
- [ ] Drawer send request when apply filters
|
|
795
|
+
- [ ] Clear all feature for Drawer
|
|
796
|
+
- [ ] Stripo's controls should be effect specific DOM item -- Try extending CommonControl class
|
|
797
|
+
- [ ] Show toaster message if uses multiple recommendation blocks in same template
|
|
798
|
+
- [ ] Change filter button text as Change Filters
|
|
799
|
+
- [ ] Migration template for Recommendation Block
|
|
800
|
+
- [ ] Recommendation Algorithm default value should be mostPopular
|
|
801
|
+
- [ ] Default fields for empty template like currency, title etc.
|
|
802
|
+
- [ ] Recommendation Block Icon Registry should be updated
|
|
803
|
+
- [ ] AMP Block Icon should be updated
|
|
804
|
+
- [ ] Padding feature for between Product Rows
|
|
805
|
+
|
|
806
|
+
Items Block Phase 2:
|
|
807
|
+
[ ] Writing configs to esd-config-data DOM.
|
|
808
|
+
[ ] Build on save feature should be working
|
|
809
|
+
[ ] Data Migration feature should be working
|
|
810
|
+
|
|
811
|
+
Tech Debts:
|
|
812
|
+
[ ] Merge Custom Blocks into a single File
|
|
813
|
+
[ ] Move Custom Blocks names to an enum file
|
|
814
|
+
[ ] Template Replacement should be optimized for version history
|
|
815
|
+
[ ] Code Optimization for Items Block inner blocks reordering
|
|
816
|
+
[ ] Image Size & Margins controls has an error on console
|
|
817
|
+
[ ] Feed Text Trimming feature to toggle settings
|
|
818
|
+
[ ] Formatted Price feature to toggle settings
|
|
@@ -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,48 @@
|
|
|
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": () => import("../extensions/Blocks/Items/extension.js")
|
|
23
|
+
}, a = (n) => {
|
|
24
|
+
if (!n || !n.length)
|
|
25
|
+
return {};
|
|
26
|
+
const o = {};
|
|
27
|
+
return n.forEach((e) => {
|
|
28
|
+
const t = l[e];
|
|
29
|
+
t && (o[t] = !1);
|
|
30
|
+
}), o;
|
|
31
|
+
}, r = async (n) => !n || !n.length ? [] : (await Promise.all(
|
|
32
|
+
n.map(async (e) => {
|
|
33
|
+
const t = c[e];
|
|
34
|
+
return t ? (await t()).default : null;
|
|
35
|
+
})
|
|
36
|
+
)).filter((e) => e !== null), s = () => ({
|
|
37
|
+
getStripoBlocksConfig: async () => {
|
|
38
|
+
var e;
|
|
39
|
+
const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
|
|
40
|
+
return {
|
|
41
|
+
baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
|
|
42
|
+
extensions: await r(o == null ? void 0 : o.includeCustoms)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
s as useBlocksConfig
|
|
48
|
+
};
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import _ from "../extensions/Blocks/Unsubscribe/extension.js";
|
|
11
|
-
import k from "../extensions/DynamicContent/extension.js";
|
|
12
|
-
import { useStripoApi as B } from "../services/stripoApi.js";
|
|
13
|
-
import x from "../static/styles/customEditorStyle.css.js";
|
|
14
|
-
import { useEditorStore as F } from "../stores/editor.js";
|
|
1
|
+
import { useActionsApi as E } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as y } from "./useBlocksConfig.js";
|
|
3
|
+
import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
|
|
4
|
+
import { useStripoEventHandler as h } from "./useStripoEventHandler.js";
|
|
5
|
+
import { useToaster as b } from "./useToaster.js";
|
|
6
|
+
import { displayConditions as k } from "../enums/displayConditions.js";
|
|
7
|
+
import { useStripoApi as V } from "../services/stripoApi.js";
|
|
8
|
+
import _ from "../static/styles/customEditorStyle.css.js";
|
|
9
|
+
import { useEditorStore as B } from "../stores/editor.js";
|
|
15
10
|
import { dynamicContentToMergeTags as A } from "../utils/genericUtil.js";
|
|
16
|
-
import
|
|
17
|
-
const
|
|
18
|
-
const { handleError:
|
|
19
|
-
const t =
|
|
11
|
+
import F from "../package.json.js";
|
|
12
|
+
const L = (d) => {
|
|
13
|
+
const { handleError: u } = b(), { getToken: p, getCustomFonts: m } = V(), { handleEvent: g } = h(), { getStripoBlocksConfig: f } = y(), S = async (r, i = []) => {
|
|
14
|
+
const t = B(), { html: n, css: l, forceRecreate: a } = r, { baseBlocks: e, extensions: c } = await f();
|
|
20
15
|
window.UIEditor.initEditor(
|
|
21
16
|
document.querySelector("#guido-editor"),
|
|
22
17
|
{
|
|
23
|
-
metadata:
|
|
18
|
+
metadata: d,
|
|
24
19
|
html: n,
|
|
25
|
-
css:
|
|
26
|
-
forceRecreate:
|
|
20
|
+
css: l,
|
|
21
|
+
forceRecreate: a,
|
|
27
22
|
locale: "en",
|
|
28
23
|
undoButtonSelector: "#guido__undo-button",
|
|
29
24
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -33,13 +28,14 @@ const G = (a) => {
|
|
|
33
28
|
customAppearanceMergetags: !0,
|
|
34
29
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
35
30
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
36
|
-
customViewStyles:
|
|
31
|
+
customViewStyles: _,
|
|
37
32
|
conditionsEnabled: !0,
|
|
38
33
|
customConditionsEnabled: !0,
|
|
39
|
-
conditionCategories:
|
|
34
|
+
conditionCategories: k,
|
|
40
35
|
enableXSSSecurity: !0,
|
|
41
36
|
messageSettingsEnabled: !1,
|
|
42
|
-
|
|
37
|
+
selectElementAfterDrop: !0,
|
|
38
|
+
...e ? { baseBlocks: e } : {},
|
|
43
39
|
editorFonts: {
|
|
44
40
|
showDefaultStandardFonts: !0,
|
|
45
41
|
showDefaultNotStandardFonts: !0,
|
|
@@ -47,25 +43,25 @@ const G = (a) => {
|
|
|
47
43
|
},
|
|
48
44
|
mergeTags: [
|
|
49
45
|
{
|
|
50
|
-
entries: A(
|
|
46
|
+
entries: A(d.preselectedDynamicContentList)
|
|
51
47
|
}
|
|
52
48
|
],
|
|
53
49
|
async onTokenRefreshRequest(o) {
|
|
54
50
|
try {
|
|
55
|
-
const
|
|
56
|
-
o(
|
|
57
|
-
} catch (
|
|
58
|
-
|
|
51
|
+
const s = await p();
|
|
52
|
+
o(s);
|
|
53
|
+
} catch (s) {
|
|
54
|
+
u(s, "Failed to refresh token");
|
|
59
55
|
}
|
|
60
56
|
},
|
|
61
57
|
onTemplateLoaded() {
|
|
62
58
|
try {
|
|
63
|
-
const { importCss: o } =
|
|
64
|
-
o(),
|
|
59
|
+
const { importCss: o } = w(), { activateCustomViewStyles: s } = E();
|
|
60
|
+
o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
65
61
|
t.hasChanges = !1;
|
|
66
62
|
}, 1e3);
|
|
67
63
|
} catch (o) {
|
|
68
|
-
|
|
64
|
+
u(o, "Failed to load custom interface appearance");
|
|
69
65
|
}
|
|
70
66
|
},
|
|
71
67
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -80,42 +76,35 @@ const G = (a) => {
|
|
|
80
76
|
onDataChanged() {
|
|
81
77
|
t.hasChanges = !0;
|
|
82
78
|
},
|
|
83
|
-
onEvent:
|
|
79
|
+
onEvent: g,
|
|
84
80
|
ignoreClickOutsideSelectors: [
|
|
85
81
|
"#guido-dynamic-content-modal",
|
|
86
82
|
".in-on-board-wrapper",
|
|
87
83
|
".in-drawer__container"
|
|
88
84
|
],
|
|
89
|
-
extensions:
|
|
90
|
-
k,
|
|
91
|
-
h,
|
|
92
|
-
b,
|
|
93
|
-
V,
|
|
94
|
-
_,
|
|
95
|
-
w
|
|
96
|
-
]
|
|
85
|
+
extensions: c
|
|
97
86
|
}
|
|
98
87
|
);
|
|
99
|
-
},
|
|
100
|
-
var
|
|
88
|
+
}, C = (r) => new Promise((i, t) => {
|
|
89
|
+
var c;
|
|
101
90
|
if (document.getElementById("UiEditorScript")) {
|
|
102
91
|
r(), i();
|
|
103
92
|
return;
|
|
104
93
|
}
|
|
105
|
-
const n =
|
|
106
|
-
|
|
94
|
+
const n = F.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
|
|
95
|
+
e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
|
|
107
96
|
r(), i();
|
|
108
|
-
},
|
|
109
|
-
t(new Error(`Failed to load Stripo UIEditor script from S3: ${
|
|
110
|
-
}, document.body.appendChild(
|
|
97
|
+
}, e.onerror = () => {
|
|
98
|
+
t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
99
|
+
}, document.body.appendChild(e);
|
|
111
100
|
});
|
|
112
101
|
return { initPlugin: async (r) => {
|
|
113
|
-
await
|
|
102
|
+
await C(async () => {
|
|
114
103
|
const i = await m();
|
|
115
|
-
|
|
104
|
+
await S(r, i);
|
|
116
105
|
});
|
|
117
106
|
} };
|
|
118
107
|
};
|
|
119
108
|
export {
|
|
120
|
-
|
|
109
|
+
L as useStripo
|
|
121
110
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
1
|
+
import { migrateCheckbox as m } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateRadioButton as i } from "./radioButtonMigrator.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { migrateRecommendation as e } from "./recommendationMigrator.js";
|
|
5
|
+
import { migrateUnsubscribe as a } from "./unsubscribeMigrator.js";
|
|
6
|
+
const s = async (t) => {
|
|
6
7
|
let r = t;
|
|
7
|
-
return r =
|
|
8
|
+
return r = m(r), r = i(r), r = await a(r), r = o(r), r = e(r), r;
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
s as migrate
|
|
11
12
|
};
|