@useinsider/guido 2.1.0-beta.42a4f11 → 2.1.0-beta.486ee9c
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/dist/@types/config/schemas.js +1 -1
- package/dist/components/organisms/base/Toaster.vue.js +4 -4
- package/dist/components/organisms/base/Toaster.vue2.js +12 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +54 -23
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +7 -5
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +34 -21
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +48 -36
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +11 -9
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useRecommendation.js +9 -9
- package/dist/composables/useStripo.js +25 -23
- package/dist/composables/useVersionHistoryApi.js +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +1 -1
- package/dist/config/i18n/en/index.js +11 -0
- package/dist/config/i18n/en/labels.json.js +7 -0
- package/dist/config/i18n/en/toasters.json.js +56 -0
- package/dist/config/i18n/en/tooltips.json.js +82 -0
- package/dist/config/i18n/index.js +7 -0
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -33
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +16 -14
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +41 -29
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +30 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +194 -104
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +46 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +291 -217
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +223 -99
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +172 -85
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +32 -32
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
- package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +17 -1
- package/dist/src/config/i18n/en/index.d.ts +1 -0
- package/dist/src/config/i18n/index.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +27 -14
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +50 -17
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +19 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/static/styles/components/notification.css.js +18 -0
- package/dist/static/styles/components/tools.css.js +6 -2
- package/dist/static/styles/customEditorStyle.css.js +50 -23
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/package.json +2 -2
|
@@ -5,16 +5,20 @@
|
|
|
5
5
|
* - Column spacing: horizontal gap between cards in the same row
|
|
6
6
|
* - Row spacing: vertical gap between different rows
|
|
7
7
|
*
|
|
8
|
+
* Desktop and mobile have independent spacing controls that toggle
|
|
9
|
+
* visibility based on Stripo's editor preview mode (desktop/mobile).
|
|
10
|
+
*
|
|
8
11
|
* Configuration is stored via node config (persists with template).
|
|
9
12
|
* Actual spacing is applied to DOM elements via inline styles.
|
|
10
13
|
*/
|
|
11
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
14
|
+
import { type ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
12
15
|
import { CommonControl } from '../../../common-control';
|
|
13
16
|
export declare const SPACING_CONTROL_ID = "recommendation-spacing-control";
|
|
14
17
|
/**
|
|
15
18
|
* Control for managing spacing between product cards
|
|
16
19
|
* - Column spacing: horizontal gap between cards in the same row
|
|
17
20
|
* - Row spacing: vertical gap between different rows
|
|
21
|
+
* - Separate controls for desktop and mobile with device-mode toggling
|
|
18
22
|
*/
|
|
19
23
|
export declare class SpacingControl extends CommonControl {
|
|
20
24
|
private store;
|
|
@@ -25,17 +29,28 @@ export declare class SpacingControl extends CommonControl {
|
|
|
25
29
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
26
30
|
onDestroy(): void;
|
|
27
31
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
32
|
+
* Checks if the editor is currently in mobile preview mode
|
|
33
|
+
* using Stripo's EditorStatePropertyType API.
|
|
34
|
+
*/
|
|
35
|
+
_isMobileMode(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Updates spacing control visibility based on layout orientation, editor mode,
|
|
38
|
+
* and products-per-row count.
|
|
39
|
+
* - List layout: hide column spacing (products are full-width), hide ALL mobile
|
|
40
|
+
* spacing controls (list is responsive — single row spacing applies to both views)
|
|
41
|
+
* - Desktop mode: show desktop spacing, hide mobile spacing
|
|
42
|
+
* - Mobile mode: show mobile spacing, hide desktop spacing
|
|
43
|
+
* - 1 product per row: hide column spacing (no gap between single column)
|
|
31
44
|
*/
|
|
32
|
-
|
|
45
|
+
_updateSpacingVisibility(): void;
|
|
33
46
|
/**
|
|
34
|
-
* Reads spacing values from node config first, falls back to DOM styles
|
|
47
|
+
* Reads spacing values from node config first, falls back to DOM styles.
|
|
48
|
+
* DOM fallback is only used for legacy templates that lack node config.
|
|
35
49
|
*/
|
|
36
50
|
_setFormValues(): void;
|
|
37
51
|
/**
|
|
38
52
|
* Gets stored column spacing from the first attribute row cell's padding.
|
|
53
|
+
* Scoped to the desktop container for accurate readings.
|
|
39
54
|
* For grid layout: cells inside .recommendation-attribute-row have padding applied.
|
|
40
55
|
* For list layout: the parent of .product-card-wrapper has the padding.
|
|
41
56
|
* The padding is applied as "0 {halfSpacing}px", so we extract and multiply by 2.
|
|
@@ -43,27 +58,33 @@ export declare class SpacingControl extends CommonControl {
|
|
|
43
58
|
_getStoredColumnSpacing(): number;
|
|
44
59
|
/**
|
|
45
60
|
* Gets stored row spacing from the first spacer element's height style
|
|
61
|
+
* Scoped to the desktop container for accurate readings.
|
|
46
62
|
*/
|
|
47
63
|
_getStoredRowSpacing(): number;
|
|
48
64
|
/**
|
|
49
|
-
* Handles column spacing changes.
|
|
50
|
-
*
|
|
51
|
-
* For list layout: applies padding to parent of product card wrappers.
|
|
65
|
+
* Handles column spacing changes for desktop.
|
|
66
|
+
* Applies horizontal padding only to the desktop container elements.
|
|
52
67
|
*/
|
|
53
68
|
_onColumnSpacingChange(spacing: number): void;
|
|
54
69
|
/**
|
|
55
|
-
* Handles row spacing changes
|
|
56
|
-
* Applies height to
|
|
70
|
+
* Handles row spacing changes for desktop.
|
|
71
|
+
* Applies height only to spacer elements in the desktop container.
|
|
57
72
|
*/
|
|
58
73
|
_onRowSpacingChange(spacing: number): void;
|
|
59
74
|
/**
|
|
60
|
-
*
|
|
75
|
+
* Handles column spacing changes for mobile.
|
|
76
|
+
* Applies horizontal padding only to the mobile container elements.
|
|
61
77
|
*/
|
|
62
|
-
|
|
78
|
+
_onMobileColumnSpacingChange(spacing: number): void;
|
|
63
79
|
/**
|
|
64
|
-
*
|
|
80
|
+
* Handles row spacing changes for mobile.
|
|
81
|
+
* Applies height only to spacer elements in the mobile container.
|
|
65
82
|
*/
|
|
66
|
-
|
|
83
|
+
_onMobileRowSpacingChange(spacing: number): void;
|
|
84
|
+
/**
|
|
85
|
+
* Stores a spacing value as a data attribute on the block root element
|
|
86
|
+
*/
|
|
87
|
+
_storeDataAttribute(attr: string, spacing: number): void;
|
|
67
88
|
_listenToFormUpdates(): void;
|
|
68
89
|
/**
|
|
69
90
|
* Debounced version of _onColumnSpacingChange
|
|
@@ -72,12 +93,24 @@ export declare class SpacingControl extends CommonControl {
|
|
|
72
93
|
_debouncedOnColumnSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
73
94
|
/**
|
|
74
95
|
* Debounced version of _onRowSpacingChange
|
|
75
|
-
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
76
96
|
*/
|
|
77
97
|
_debouncedOnRowSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
98
|
+
/**
|
|
99
|
+
* Debounced version of _onMobileColumnSpacingChange
|
|
100
|
+
*/
|
|
101
|
+
_debouncedOnMobileColumnSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
102
|
+
/**
|
|
103
|
+
* Debounced version of _onMobileRowSpacingChange
|
|
104
|
+
*/
|
|
105
|
+
_debouncedOnMobileRowSpacingChange: import("@vueuse/shared").PromisifyFn<(spacing: number) => void>;
|
|
78
106
|
/**
|
|
79
107
|
* Subscribe to store orientation changes
|
|
80
|
-
* Updates
|
|
108
|
+
* Updates spacing visibility when layout changes via the layout control
|
|
81
109
|
*/
|
|
82
110
|
_subscribeToOrientationChanges(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Subscribes to editor preview mode changes via Stripo API.
|
|
113
|
+
* Toggles which spacing controls (desktop/mobile) are visible.
|
|
114
|
+
*/
|
|
115
|
+
_subscribeToEditorModeChanges(): void;
|
|
83
116
|
}
|
|
@@ -31,6 +31,8 @@ interface PerBlockState {
|
|
|
31
31
|
filterGroup: number;
|
|
32
32
|
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
33
33
|
isInitialized: boolean;
|
|
34
|
+
/** Snapshot of filters taken when the drawer opens, used to revert on cancel */
|
|
35
|
+
filterSnapshot: Filter[] | null;
|
|
34
36
|
}
|
|
35
37
|
interface StoreState {
|
|
36
38
|
recommendationCampaignUrls: Record<string, string>;
|
|
@@ -125,7 +127,9 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
125
127
|
configVersion: number;
|
|
126
128
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
127
129
|
hasFilters(): boolean;
|
|
130
|
+
hasValidFilters(): boolean;
|
|
128
131
|
getFilterGroupCount(): number;
|
|
132
|
+
getUniqueFilterGroups(): number[];
|
|
129
133
|
getActivePredictiveAlgorithms: (state: {
|
|
130
134
|
recommendationCampaignUrls: Record<string, string>;
|
|
131
135
|
activePredictiveAlgorithms: number[];
|
|
@@ -203,23 +207,36 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
203
207
|
patchCurrentBlockConfig(updates: Partial<PerBlockConfigs>, options?: {
|
|
204
208
|
triggerRefetch?: boolean;
|
|
205
209
|
}): void;
|
|
210
|
+
/**
|
|
211
|
+
* Creates a filter with the first available attribute and operator pre-selected.
|
|
212
|
+
*/
|
|
213
|
+
createDefaultFilter(filterGroup: number, filterNumber: number): Filter;
|
|
206
214
|
/**
|
|
207
215
|
* Opens the filter selection drawer for the current block.
|
|
208
|
-
*
|
|
216
|
+
* Saves a snapshot of current filters for cancel/revert.
|
|
217
|
+
* If no filters exist, initializes with a default filter
|
|
209
218
|
* so the user has a starting point for input.
|
|
210
219
|
*/
|
|
211
220
|
openFilterDrawer(): void;
|
|
212
221
|
/**
|
|
213
|
-
* Closes the filter selection drawer for the current block
|
|
222
|
+
* Closes the filter selection drawer for the current block.
|
|
223
|
+
* Called after successful apply — discards the snapshot.
|
|
214
224
|
*/
|
|
215
225
|
closeFilterDrawer(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Cancels the filter selection drawer and reverts filters
|
|
228
|
+
* to the snapshot taken when the drawer was opened.
|
|
229
|
+
*/
|
|
230
|
+
cancelFilterDrawer(): void;
|
|
216
231
|
fetchRecommendationCreateData(): Promise<void>;
|
|
217
232
|
fetchRecommendationFilters(): Promise<void>;
|
|
218
233
|
addFilterGroup(filterGroup: number): void;
|
|
234
|
+
deleteFilterGroup(groupId: number): void;
|
|
219
235
|
updateFilter(updatedFilter: Filter): void;
|
|
220
236
|
deleteFilter(filter: Filter): void;
|
|
221
237
|
addFilter(filter: Filter): void;
|
|
222
238
|
generateFilterQuery(): string;
|
|
223
239
|
fetchRecommendationProducts(): Promise<void>;
|
|
240
|
+
_doFetchProducts(): Promise<void>;
|
|
224
241
|
}>;
|
|
225
242
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
2
|
import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY } from '../utils';
|
|
3
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"
|
|
3
|
+
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"recommendation-block-v2 esd-block-recommendation-v3-block esd-extension-block es-p20\"\n >\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
4
4
|
/**
|
|
5
5
|
* Prepares migration product rows with attribute-aligned structure.
|
|
6
6
|
* @param products - Array of products to display
|
|
@@ -24,14 +24,16 @@ export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefault
|
|
|
24
24
|
export declare function prepareProductRows(products: RecommendationProduct[], layout: Orientation, options?: PrepareProductRowsOptions): string;
|
|
25
25
|
/**
|
|
26
26
|
* Generates the default template for a given layout.
|
|
27
|
-
*
|
|
27
|
+
* Grid layout includes both desktop and mobile product containers.
|
|
28
|
+
* List layout only populates the desktop container (list rows are responsive).
|
|
28
29
|
* @param layout - The layout orientation ('list' or 'grid')
|
|
29
30
|
* @returns Complete HTML template with default products
|
|
30
31
|
*/
|
|
31
32
|
export declare function getDefaultTemplate(layout?: Orientation): string;
|
|
32
33
|
/**
|
|
33
34
|
* Generates a complete block template with custom products.
|
|
34
|
-
*
|
|
35
|
+
* Grid layout includes both desktop and mobile product containers.
|
|
36
|
+
* List layout only populates the desktop container (list rows are responsive).
|
|
35
37
|
* @param products - Array of products to display
|
|
36
38
|
* @param layout - The layout orientation ('list' or 'grid')
|
|
37
39
|
* @param title - Title for the block
|
|
@@ -4,7 +4,7 @@ import { DEFAULTS, getDefaultProducts } from '../utils';
|
|
|
4
4
|
* Migration template for list layout
|
|
5
5
|
* Used when migrating old recommendation blocks to list format
|
|
6
6
|
*/
|
|
7
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"
|
|
7
|
+
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"recommendation-block-v2 esd-block-recommendation-v3-block\n esd-extension-block es-p20 es-m-p0 ins-recommendation-list-layout\"\n data-layout=\"list\"\n >\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
8
8
|
export declare function getMigrationTemplate(): string;
|
|
9
9
|
/**
|
|
10
10
|
* Generates a custom list migration template with specified products
|
|
@@ -61,6 +61,6 @@ export declare function getDefaultProducts(count?: number): RecommendationProduc
|
|
|
61
61
|
* @param instanceClass - Optional instance-specific class (e.g., 'ins-recommendation-v3-block-1')
|
|
62
62
|
* for CSS scoping per block instance. Must be included in the initial template HTML because
|
|
63
63
|
* Stripo's Angular rendering manages the class attribute and overwrites dynamic setAttribute changes.
|
|
64
|
-
* @returns HTML template string with {-{-TITLE-}-}, {-{-PRODUCT_ROWS-}-}, and {-{-MOBILE_PRODUCT_ROWS-}-} placeholders
|
|
64
|
+
* @returns HTML template string with {-{-TITLE-}-}, {-{-PRODUCT_ROWS-}-}, and {-{-MOBILE_PRODUCT_ROWS-}-} (grid only) placeholders
|
|
65
65
|
*/
|
|
66
66
|
export declare function createBlockTemplate(layout?: Orientation, instanceClass?: string): string;
|
|
@@ -106,6 +106,14 @@ export interface RecommendationNodeConfig {
|
|
|
106
106
|
* Vertical spacing between product rows in pixels
|
|
107
107
|
*/
|
|
108
108
|
rowSpacing: number;
|
|
109
|
+
/**
|
|
110
|
+
* Horizontal spacing between product cards on mobile in pixels (grid layout only)
|
|
111
|
+
*/
|
|
112
|
+
mobileColumnSpacing: number;
|
|
113
|
+
/**
|
|
114
|
+
* Vertical spacing between product rows on mobile in pixels
|
|
115
|
+
*/
|
|
116
|
+
mobileRowSpacing: number;
|
|
109
117
|
/**
|
|
110
118
|
* Order of card elements from top to bottom
|
|
111
119
|
* Array of ATTR_PRODUCT_* constants
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Filter } from '@@/Types/recommendation';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export declare const FilterSchema: v.ObjectSchema<{
|
|
4
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5
|
+
readonly attribute: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
6
|
+
readonly operator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
7
|
+
readonly innerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
8
|
+
readonly outerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
9
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
10
|
+
readonly filterGroup: v.NumberSchema<undefined>;
|
|
11
|
+
readonly filterNumber: v.NumberSchema<undefined>;
|
|
12
|
+
readonly isValid: v.BooleanSchema<undefined>;
|
|
13
|
+
}, undefined>;
|
|
14
|
+
export declare function isFilterValid(filter: Filter): boolean;
|
|
15
|
+
export declare function getInvalidFilterFields(filter: Filter): Set<string>;
|
|
@@ -17,6 +17,24 @@ ue-notifications-container .alert-message-wrapper {
|
|
|
17
17
|
padding: 16px 24px;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
ue-notifications-container .alert-message-wrapper.info,
|
|
21
|
+
ue-notifications-container .alert-message-wrapper.loader {
|
|
22
|
+
background-color: var(--guido-color-background-toaster-info) !important;
|
|
23
|
+
color: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.alert-message-wrapper .alert-message-main {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ue-notifications-container ue-caption .caption {
|
|
31
|
+
color: var(--guido-color-white) !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ue-block-thumb-hint {
|
|
35
|
+
text-align: left;
|
|
36
|
+
}
|
|
37
|
+
|
|
20
38
|
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
|
|
21
39
|
width: calc(100% - 64px);
|
|
22
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = `ue-emoji .emoji-tabs .active-smile-tab {
|
|
2
2
|
border-color: var(--guido-color-primary-500);
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -17,7 +17,11 @@ ue-insert-table .template-cell {
|
|
|
17
17
|
border: 1px solid var(--guido-color-gray-300);
|
|
18
18
|
box-shadow: var(--guido-box-shadow);
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
.ue-popover.dark-tiny {
|
|
22
|
+
text-align: left !important;
|
|
23
|
+
}
|
|
20
24
|
`;
|
|
21
25
|
export {
|
|
22
|
-
|
|
26
|
+
e as default
|
|
23
27
|
};
|
|
@@ -20,30 +20,30 @@ const n = `.esd-x,
|
|
|
20
20
|
}
|
|
21
21
|
.ins-product-cart ue-node-actions,
|
|
22
22
|
/* Horizontal layout - hide for info, image, and button cells */
|
|
23
|
-
.
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
23
|
+
.recommendation-block-v2 .product-info-cell ue-node-actions,
|
|
24
|
+
.recommendation-block-v2 .product-info-cell ue-node-panel,
|
|
25
|
+
.recommendation-block-v2 .product-image-cell ue-node-actions,
|
|
26
|
+
.recommendation-block-v2 .product-image-cell ue-node-panel,
|
|
27
|
+
.recommendation-block-v2 .button-cell ue-node-actions,
|
|
28
|
+
.recommendation-block-v2 .button-cell ue-node-panel,
|
|
29
29
|
/* Vertical layout - hide for product-card-segment inner cells */
|
|
30
|
-
.
|
|
31
|
-
.
|
|
30
|
+
.recommendation-block-v2 .product-card-segment ue-node-actions,
|
|
31
|
+
.recommendation-block-v2 .product-card-segment ue-node-panel,
|
|
32
32
|
/* Hide for specific product attribute cells in both layouts */
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
37
|
-
.
|
|
38
|
-
.
|
|
39
|
-
.
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.
|
|
33
|
+
.recommendation-block-v2 .product-image ue-node-actions,
|
|
34
|
+
.recommendation-block-v2 .product-image ue-node-panel,
|
|
35
|
+
.recommendation-block-v2 .product-name ue-node-actions,
|
|
36
|
+
.recommendation-block-v2 .product-name ue-node-panel,
|
|
37
|
+
.recommendation-block-v2 .product-price ue-node-actions,
|
|
38
|
+
.recommendation-block-v2 .product-price ue-node-panel,
|
|
39
|
+
.recommendation-block-v2 .product-old-price ue-node-actions,
|
|
40
|
+
.recommendation-block-v2 .product-old-price ue-node-panel,
|
|
41
|
+
.recommendation-block-v2 .product-omnibus-price ue-node-actions,
|
|
42
|
+
.recommendation-block-v2 .product-omnibus-price ue-node-panel,
|
|
43
|
+
.recommendation-block-v2 .product-omnibus-discount ue-node-actions,
|
|
44
|
+
.recommendation-block-v2 .product-omnibus-discount ue-node-panel,
|
|
45
|
+
.recommendation-block-v2 .product-button ue-node-actions,
|
|
46
|
+
.recommendation-block-v2 .product-button ue-node-panel {
|
|
47
47
|
display: none !important;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -52,7 +52,7 @@ const n = `.esd-x,
|
|
|
52
52
|
display: none;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/* Mobile layout: when Stripo mobile mode is active, swap containers */
|
|
55
|
+
/* Mobile layout: when Stripo mobile mode is active, swap containers (grid layout only) */
|
|
56
56
|
.ue-mobile-mode .ins-recommendation-desktop-container {
|
|
57
57
|
display: none !important;
|
|
58
58
|
}
|
|
@@ -60,6 +60,33 @@ const n = `.esd-x,
|
|
|
60
60
|
.ue-mobile-mode .ins-recommendation-mobile-container {
|
|
61
61
|
display: table !important;
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
/* List layout: keep desktop container visible in mobile mode (list rows are inherently responsive)
|
|
65
|
+
Uses class selector instead of [data-layout="list"] for Gmail compatibility */
|
|
66
|
+
.ue-mobile-mode .ins-recommendation-list-layout .ins-recommendation-desktop-container {
|
|
67
|
+
display: table !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ue-mobile-mode .ins-recommendation-list-layout .ins-recommendation-mobile-container {
|
|
71
|
+
display: none !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* List layout mobile: reduce image and button width for better text readability */
|
|
75
|
+
.ue-mobile-mode .ins-recommendation-list-layout .product-image-cell {
|
|
76
|
+
width: 80px !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ue-mobile-mode .ins-recommendation-list-layout .product-image-cell img {
|
|
80
|
+
max-width: 80px !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ue-mobile-mode .ins-recommendation-list-layout .button-cell {
|
|
84
|
+
width: 80px !important;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ue-mobile-mode .ins-recommendation-list-layout .product-info-cell {
|
|
88
|
+
padding: 5px 8px !important;
|
|
89
|
+
}
|
|
63
90
|
`;
|
|
64
91
|
export {
|
|
65
92
|
n as default
|
|
@@ -10,6 +10,7 @@ const o = `:host {
|
|
|
10
10
|
--guido-color-gray-1: #F0F0F0;
|
|
11
11
|
--guido-color-gray-0: #F9F9F9;
|
|
12
12
|
--guido-color-neutral-800: #222938;
|
|
13
|
+
--guido-color-neutral-700: #2C3546;
|
|
13
14
|
--guido-color-neutral-200: #DCDFE6;
|
|
14
15
|
--guido-color-neutral-100: #EFF2F4;
|
|
15
16
|
--guido-color-danger-300: #e84342;
|
|
@@ -25,6 +26,7 @@ const o = `:host {
|
|
|
25
26
|
--guido-color-border-onpage-message-error: var(--guido-color-danger-500);
|
|
26
27
|
--guido-color-background-toaster-success: #128745;
|
|
27
28
|
--guido-color-background-toaster-error: var(--guido-color-danger-500);
|
|
29
|
+
--guido-color-background-toaster-info: var(--guido-color-neutral-700);
|
|
28
30
|
--guido-color-background-toaster-warn: #D37400;
|
|
29
31
|
}
|
|
30
32
|
`;
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { TYPE_COLLECTIONS as i, PAGE_TYPES as
|
|
2
|
-
import { useUnsubscribeApi as
|
|
3
|
-
import { defineStore as
|
|
4
|
-
|
|
1
|
+
import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
|
|
2
|
+
import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
|
|
3
|
+
import { defineStore as h } from "pinia";
|
|
4
|
+
let o = null;
|
|
5
|
+
const r = () => ({
|
|
5
6
|
templates: [],
|
|
6
7
|
selectedTemplates: {},
|
|
7
8
|
selectedUnsubscribePages: [],
|
|
8
|
-
selectedCollectionType:
|
|
9
|
-
activeType:
|
|
9
|
+
selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
|
|
10
|
+
activeType: p.GLOBAL_UNSUBSCRIBE,
|
|
10
11
|
pageSelectionUpdateStatus: !1,
|
|
11
12
|
pageSelectionDrawerStatus: !1,
|
|
12
13
|
typeSelectionDrawerStatus: !1,
|
|
13
14
|
isGlobalUnsubscribeDisabled: !1,
|
|
14
15
|
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}),
|
|
16
|
-
state: () =>
|
|
16
|
+
}), b = h("guidoUnsubscribe", {
|
|
17
|
+
state: () => r(),
|
|
17
18
|
getters: {
|
|
18
19
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
19
20
|
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
20
21
|
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
21
22
|
getThumbnailByTemplateId: (e) => (t) => {
|
|
22
|
-
var
|
|
23
|
-
return ((
|
|
23
|
+
var l;
|
|
24
|
+
return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
|
|
24
25
|
},
|
|
25
26
|
getSelectedUnsubscribePagesByCollection: (e) => (t) => {
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
27
|
+
const l = i[t];
|
|
28
|
+
if (!l)
|
|
28
29
|
return [];
|
|
29
30
|
const s = /* @__PURE__ */ new Map();
|
|
30
31
|
e.templates.forEach((n) => {
|
|
31
32
|
s.set(n.id, n.type);
|
|
32
33
|
});
|
|
33
|
-
const
|
|
34
|
+
const c = new Set(l);
|
|
34
35
|
return e.selectedUnsubscribePages.filter((n) => {
|
|
35
|
-
const
|
|
36
|
-
return
|
|
36
|
+
const a = s.get(n);
|
|
37
|
+
return a !== void 0 && c.has(a);
|
|
37
38
|
});
|
|
38
39
|
},
|
|
39
40
|
isActiveTypeFirstInCollection: (e) => {
|
|
@@ -47,7 +48,7 @@ const p = () => ({
|
|
|
47
48
|
hasTemplatesByCollectionType: (e) => {
|
|
48
49
|
const t = {};
|
|
49
50
|
return i[e.selectedCollectionType].forEach((s) => {
|
|
50
|
-
t[s] = e.templates.some((
|
|
51
|
+
t[s] = e.templates.some((c) => c.type === s);
|
|
51
52
|
}), t;
|
|
52
53
|
},
|
|
53
54
|
unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
|
|
@@ -56,29 +57,31 @@ const p = () => ({
|
|
|
56
57
|
$reset() {
|
|
57
58
|
const { templates: e, selectedUnsubscribePages: t } = this;
|
|
58
59
|
Object.assign(this, {
|
|
59
|
-
...
|
|
60
|
+
...r(),
|
|
60
61
|
templates: e,
|
|
61
62
|
selectedUnsubscribePages: t
|
|
62
63
|
});
|
|
63
64
|
},
|
|
64
65
|
async fetchTemplates() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
this.templates.length || (o || (o = (async () => {
|
|
67
|
+
const { getUnsubscribePages: e } = d();
|
|
68
|
+
this.templates = await e();
|
|
69
|
+
})().finally(() => {
|
|
70
|
+
o = null;
|
|
71
|
+
})), await o);
|
|
69
72
|
},
|
|
70
73
|
setCollection(e) {
|
|
71
74
|
this.selectedCollectionType = e;
|
|
72
75
|
const t = i[e];
|
|
73
76
|
if (t && t.length > 0) {
|
|
74
77
|
[this.activeType] = t;
|
|
75
|
-
const
|
|
78
|
+
const l = { ...this.selectedTemplates };
|
|
76
79
|
t.forEach((s) => {
|
|
77
|
-
if (!
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
+
if (!l[s]) {
|
|
81
|
+
const c = this.templates.find((n) => n.type === s);
|
|
82
|
+
c && (l[s] = c.id);
|
|
80
83
|
}
|
|
81
|
-
}), this.selectedTemplates =
|
|
84
|
+
}), this.selectedTemplates = l;
|
|
82
85
|
}
|
|
83
86
|
},
|
|
84
87
|
setCollectionWithoutAutoSelection(e) {
|
|
@@ -101,17 +104,17 @@ const p = () => ({
|
|
|
101
104
|
t >= 0 && (this.activeType = this.getSelectedCollection[t]);
|
|
102
105
|
},
|
|
103
106
|
loadSelectedTemplates(e) {
|
|
104
|
-
const t = new Map(this.templates.map((s) => [s.id, s.type])),
|
|
107
|
+
const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
|
|
105
108
|
e.forEach((s) => {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
}), this.selectedTemplates =
|
|
109
|
+
const c = t.get(s);
|
|
110
|
+
c !== void 0 && (l[c] = s);
|
|
111
|
+
}), this.selectedTemplates = l;
|
|
109
112
|
},
|
|
110
113
|
getSelectedTemplatesByCollection(e) {
|
|
111
|
-
const t = i[e],
|
|
114
|
+
const t = i[e], l = [];
|
|
112
115
|
return t.forEach((s) => {
|
|
113
|
-
this.selectedTemplates[s] &&
|
|
114
|
-
}),
|
|
116
|
+
this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
|
|
117
|
+
}), l;
|
|
115
118
|
},
|
|
116
119
|
addUnsubscribePages(e) {
|
|
117
120
|
const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
|
|
@@ -125,5 +128,5 @@ const p = () => ({
|
|
|
125
128
|
}
|
|
126
129
|
});
|
|
127
130
|
export {
|
|
128
|
-
|
|
131
|
+
b as useUnsubscribeStore
|
|
129
132
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.486ee9c",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
35
|
-
"@useinsider/design-system-vue": "0.14.
|
|
35
|
+
"@useinsider/design-system-vue": "0.14.28",
|
|
36
36
|
"@vueuse/core": "11.3.0",
|
|
37
37
|
"lodash-es": "4.17.21",
|
|
38
38
|
"pinia": "2.3.1",
|