@useinsider/guido 2.1.0-beta.9ba2e9d → 2.1.0-beta.a67f307
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 +36 -0
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +69 -58
- package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
- package/dist/composables/useBlocksConfig.js +26 -16
- package/dist/composables/useHtmlValidator.js +107 -119
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +70 -96
- package/dist/config/migrator/itemsBlockMigrator.js +101 -97
- package/dist/enums/defaults.js +8 -4
- package/dist/enums/extensions/recommendationBlock.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +26 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +117 -107
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +43 -31
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
- package/dist/services/recommendationApi.js +11 -9
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/static/styles/components/notification.css.js +1 -0
- package/dist/static/styles/components/version-history.css.js +10 -2
- package/dist/static/styles/components/wide-panel.css.js +18 -2
- package/dist/static/styles/customEditorStyle.css.js +10 -9
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
const { get: o } =
|
|
1
|
+
import { useHttp as c } from "../composables/useHttp.js";
|
|
2
|
+
import { URLS as m } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const f = () => {
|
|
4
|
+
const { get: o } = c();
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
@@ -18,13 +18,15 @@ const u = () => {
|
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, a) => {
|
|
22
22
|
var n;
|
|
23
23
|
try {
|
|
24
|
-
const t = decodeURIComponent(new URLSearchParams(Object.entries(
|
|
24
|
+
const t = decodeURIComponent(new URLSearchParams(Object.entries(a)).toString());
|
|
25
25
|
console.debug("🏁 Recommendation API Query:", t);
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const { get: s } = c({
|
|
27
|
+
headers: {}
|
|
28
|
+
}), r = await s(
|
|
29
|
+
`${m.RECOMMENDATION_API_URL}/v2/${e}?${t}`
|
|
28
30
|
);
|
|
29
31
|
return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
|
|
30
32
|
} catch (t) {
|
|
@@ -34,5 +36,5 @@ const u = () => {
|
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
f as useRecommendationApi
|
|
38
40
|
};
|
|
@@ -129,6 +129,10 @@ export declare const EditorSchema: v.ObjectSchema<{
|
|
|
129
129
|
readonly senderName: "";
|
|
130
130
|
readonly subject: "";
|
|
131
131
|
}>;
|
|
132
|
+
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
133
|
+
readonly savedModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "savedModules">;
|
|
134
|
+
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
135
|
+
readonly defaultModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "defaultModules">;
|
|
132
136
|
}, undefined>;
|
|
133
137
|
/**
|
|
134
138
|
* UI configuration - visual elements and layout
|
|
@@ -441,6 +445,10 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
441
445
|
readonly senderName: "";
|
|
442
446
|
readonly subject: "";
|
|
443
447
|
}>;
|
|
448
|
+
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
449
|
+
readonly savedModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "savedModules">;
|
|
450
|
+
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
451
|
+
readonly defaultModulesFolderName: v.OptionalSchema<v.StringSchema<undefined>, "defaultModules">;
|
|
444
452
|
}, undefined>, {}>;
|
|
445
453
|
/** UI configuration */
|
|
446
454
|
readonly ui: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -41,6 +41,8 @@ export declare const useConfig: () => {
|
|
|
41
41
|
senderName: string;
|
|
42
42
|
subject: string;
|
|
43
43
|
};
|
|
44
|
+
savedModulesFolderName: string;
|
|
45
|
+
defaultModulesFolderName: string;
|
|
44
46
|
};
|
|
45
47
|
ui: {
|
|
46
48
|
showHeader: boolean;
|
|
@@ -130,6 +132,8 @@ export declare const useConfig: () => {
|
|
|
130
132
|
senderName: string;
|
|
131
133
|
subject: string;
|
|
132
134
|
};
|
|
135
|
+
savedModulesFolderName: string;
|
|
136
|
+
defaultModulesFolderName: string;
|
|
133
137
|
} | null>;
|
|
134
138
|
ui: import("vue").ComputedRef<{
|
|
135
139
|
showHeader: boolean;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export declare function formatPriceVariable(campaignId: string, productIndex: number, attribute: string, alignment: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* Transforms recommendation block HTML by replacing product data with
|
|
12
|
-
* template variables
|
|
12
|
+
* template variables.
|
|
13
13
|
* Preserves the full document structure (DOCTYPE, html, head, body).
|
|
14
14
|
* @param html - The raw template HTML
|
|
15
15
|
* @returns HTML with template variables replacing product data
|
|
@@ -9,3 +9,7 @@ export declare const TemplateTypes: {
|
|
|
9
9
|
export declare const EditorType: number;
|
|
10
10
|
export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
|
|
11
11
|
export declare const ProductIds: Record<string, number>;
|
|
12
|
+
export declare const ModuleFolderDefaults: {
|
|
13
|
+
readonly SAVED_MODULES: "savedModules";
|
|
14
|
+
readonly DEFAULT_MODULES: "defaultModules";
|
|
15
|
+
};
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { CONTAINER_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, } from './selectors';
|
|
12
|
-
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
11
|
+
export { CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, } from './selectors';
|
|
12
|
+
export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
13
|
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, } from './defaultConfig';
|
|
@@ -23,6 +23,12 @@ export declare const MIN_PRODUCT_COUNT = 1;
|
|
|
23
23
|
export declare const MAX_PRODUCTS_PER_ROW = 4;
|
|
24
24
|
/** Minimum number of products per row in grid layout */
|
|
25
25
|
export declare const MIN_PRODUCTS_PER_ROW = 1;
|
|
26
|
+
/** Default number of products per row on mobile */
|
|
27
|
+
export declare const DEFAULT_MOBILE_CARDS_IN_ROW = 1;
|
|
28
|
+
/** Maximum products per row on mobile */
|
|
29
|
+
export declare const MAX_MOBILE_PRODUCTS_PER_ROW = 2;
|
|
30
|
+
/** Minimum products per row on mobile */
|
|
31
|
+
export declare const MIN_MOBILE_PRODUCTS_PER_ROW = 1;
|
|
26
32
|
/** Default column spacing between product cards (5px on each side = 10px total) */
|
|
27
33
|
export declare const DEFAULT_COLUMN_SPACING = 10;
|
|
28
34
|
/** Default row spacing between product rows */
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* Used across controls to target elements within the recommendation block
|
|
7
7
|
*/
|
|
8
8
|
export declare const CONTAINER_SELECTOR = ".ins-recommendation-product-container";
|
|
9
|
+
/** Desktop product container selector */
|
|
10
|
+
export declare const DESKTOP_CONTAINER_SELECTOR = ".ins-recommendation-desktop-container";
|
|
11
|
+
/** Mobile product container selector */
|
|
12
|
+
export declare const MOBILE_CONTAINER_SELECTOR = ".ins-recommendation-mobile-container";
|
|
9
13
|
/**
|
|
10
14
|
* Currency HTML attributes set on the block element
|
|
11
15
|
* These are read by the HTML compiler at runtime to format prices
|
|
@@ -16,7 +16,6 @@ export * from './utils';
|
|
|
16
16
|
export declare class RecommendationBlockControl extends CommonControl {
|
|
17
17
|
private store;
|
|
18
18
|
private storeUnsubscription;
|
|
19
|
-
private initializedBlocks;
|
|
20
19
|
private algorithmControl;
|
|
21
20
|
private localeControl;
|
|
22
21
|
private currencyControl;
|
|
@@ -38,6 +37,18 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
38
37
|
* Each sub-control manages its own form values and event listeners
|
|
39
38
|
*/
|
|
40
39
|
_initializeSubControls(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Syncs persisted node config into the Pinia store's block state.
|
|
42
|
+
*
|
|
43
|
+
* setCurrentBlock() creates a default entry (USD, en_US, mostPopular).
|
|
44
|
+
* For saved templates, the real config lives in the node (e.g., TRY, tr_TR).
|
|
45
|
+
* This method reads it and patches the store so fetchRecommendationProducts()
|
|
46
|
+
* uses the correct values.
|
|
47
|
+
*
|
|
48
|
+
* Uses triggerRefetch: false because the fetch hasn't happened yet —
|
|
49
|
+
* values are being prepared for the upcoming initial fetch.
|
|
50
|
+
*/
|
|
51
|
+
private _syncNodeConfigToStore;
|
|
41
52
|
/**
|
|
42
53
|
* Fetches initial data for a block (filters, algorithms, products).
|
|
43
54
|
* Shared by onRender() and onTemplateNodeUpdated() to avoid duplication.
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Handles product display configuration:
|
|
5
5
|
* - Number of products to show
|
|
6
|
-
* - Products per row (hidden for list layout)
|
|
6
|
+
* - Products per row on desktop (hidden for list layout)
|
|
7
|
+
* - Products per row on mobile (hidden for list layout)
|
|
7
8
|
* - Triggers product row regeneration on changes
|
|
8
9
|
*
|
|
10
|
+
* Desktop/mobile counters swap visibility based on editor mode
|
|
11
|
+
* (detected via Stripo's EditorStatePropertyType.previewDeviceMode).
|
|
12
|
+
*
|
|
9
13
|
* Configuration is stored via node config (persists with template).
|
|
10
14
|
*/
|
|
11
15
|
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
@@ -13,6 +17,7 @@ import { CommonControl } from '../../../common-control';
|
|
|
13
17
|
export declare const PRODUCT_LAYOUT_CONTROL_ID = "recommendation-product-layout-control";
|
|
14
18
|
/**
|
|
15
19
|
* Control for configuring product count and layout density
|
|
20
|
+
* Includes both desktop and mobile "products per row" counters
|
|
16
21
|
*/
|
|
17
22
|
export declare class ProductLayoutControl extends CommonControl {
|
|
18
23
|
private store;
|
|
@@ -24,13 +29,26 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
24
29
|
onDestroy(): void;
|
|
25
30
|
_setFormValues(): void;
|
|
26
31
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
32
|
+
* Checks if the editor is currently in mobile preview mode
|
|
33
|
+
* using Stripo's EditorStatePropertyType API.
|
|
34
|
+
*/
|
|
35
|
+
_isMobileMode(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Updates counter visibility based on layout orientation and editor mode.
|
|
38
|
+
* - List layout: hide both counters (products always full-width)
|
|
39
|
+
* - Grid + desktop mode: show desktop counter, hide mobile counter
|
|
40
|
+
* - Grid + mobile mode: show mobile counter, hide desktop counter
|
|
30
41
|
*/
|
|
31
42
|
_updateProductsInRowVisibility(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Subscribes to editor preview mode changes via Stripo API.
|
|
45
|
+
* When the user switches between desktop/mobile preview, toggles
|
|
46
|
+
* which "Products in One Row" counter is visible.
|
|
47
|
+
*/
|
|
48
|
+
_subscribeToEditorModeChanges(): void;
|
|
32
49
|
_onProductCountChange(value: string): void;
|
|
33
50
|
_onProductsInRowChange(value: number): void;
|
|
51
|
+
_onMobileCardsInRowChange(value: number): void;
|
|
34
52
|
_regenerateProductRows(): void;
|
|
35
53
|
_debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
|
|
36
54
|
_listenToFormUpdates(): void;
|
|
@@ -58,8 +58,15 @@ export interface RegenerateProductRowsOptions {
|
|
|
58
58
|
layout?: Orientation;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Regenerates
|
|
62
|
-
*
|
|
61
|
+
* Regenerates only the mobile product container rows.
|
|
62
|
+
* Used when mobile-specific settings change (mobileCardsInRow)
|
|
63
|
+
* or when the desktop container is regenerated (to keep both in sync).
|
|
64
|
+
*/
|
|
65
|
+
export declare function regenerateMobileProductRows(options: Omit<RegenerateProductRowsOptions, 'afterRegenerate'>): void;
|
|
66
|
+
/**
|
|
67
|
+
* Regenerates product rows in the desktop container based on current store configuration.
|
|
68
|
+
* Also regenerates the mobile container to keep both in sync.
|
|
69
|
+
* Reads products, layout, and composition from store/DOM and rebuilds the HTML.
|
|
63
70
|
* @param options - Configuration options for regeneration
|
|
64
71
|
*/
|
|
65
72
|
export declare function regenerateProductRows(options: RegenerateProductRowsOptions): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS rules for mobile grid layout visibility switching
|
|
3
|
+
*
|
|
4
|
+
* Follows the modifyCss pattern from textTrim control.
|
|
5
|
+
* Rules are injected into the document's stylesheet via modifyCss
|
|
6
|
+
* so they appear in the compiled HTML export.
|
|
7
|
+
*/
|
|
8
|
+
import type { ImmutableCssNode } from '@stripoinc/ui-editor-extensions';
|
|
9
|
+
import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
10
|
+
/** CSS class for desktop product container */
|
|
11
|
+
export declare const CSS_CLASS_DESKTOP_CONTAINER = "ins-recommendation-desktop-container";
|
|
12
|
+
/** CSS class for mobile product container */
|
|
13
|
+
export declare const CSS_CLASS_MOBILE_CONTAINER = "ins-recommendation-mobile-container";
|
|
14
|
+
interface CssModifierApi {
|
|
15
|
+
getDocumentRootCssNode: () => ImmutableCssNode | null;
|
|
16
|
+
getDocumentModifier: () => {
|
|
17
|
+
modifyCss: (node: ImmutableCssNode) => {
|
|
18
|
+
appendRule: (rule: string) => void;
|
|
19
|
+
};
|
|
20
|
+
apply: (desc: ModificationDescription) => void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Ensures mobile layout CSS rules exist in the document stylesheet.
|
|
25
|
+
* Only adds rules if they don't already exist (prevents duplicates across multiple blocks).
|
|
26
|
+
* Follows the same pattern as textTrim's _ensureCssRulesExist().
|
|
27
|
+
*/
|
|
28
|
+
export declare function ensureMobileCssRulesExist(api: CssModifierApi): void;
|
|
29
|
+
export {};
|
|
@@ -29,6 +29,8 @@ interface PerBlockState {
|
|
|
29
29
|
filterStatus: boolean;
|
|
30
30
|
filterSelectionDrawerStatus: boolean;
|
|
31
31
|
filterGroup: number;
|
|
32
|
+
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
33
|
+
isInitialized: boolean;
|
|
32
34
|
}
|
|
33
35
|
interface StoreState {
|
|
34
36
|
recommendationCampaignUrls: Record<string, string>;
|
|
@@ -189,6 +191,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
189
191
|
* Resets currentRecommendationId if it was the deleted block.
|
|
190
192
|
*/
|
|
191
193
|
removeBlockState(id: number): void;
|
|
194
|
+
/**
|
|
195
|
+
* Marks a block as initialized (initial API data has been fetched).
|
|
196
|
+
* Automatically cleaned up when removeBlockState deletes the block entry.
|
|
197
|
+
*/
|
|
198
|
+
markBlockInitialized(id: number): void;
|
|
192
199
|
/**
|
|
193
200
|
* Patches the current block's recommendationConfigs.
|
|
194
201
|
* Replaces `store.$patch({ recommendationConfigs: { ... } })` pattern.
|
|
@@ -30,4 +30,4 @@ export declare function prepareGridProductRows(products: RecommendationProduct[]
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
32
32
|
export declare function getDefaultTemplate(recommendationId?: number): string;
|
|
33
|
-
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
33
|
+
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[], mobileProductsPerRow?: number): string;
|
|
@@ -24,12 +24,14 @@ 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
|
+
* Includes both desktop and mobile product containers for grid layouts.
|
|
27
28
|
* @param layout - The layout orientation ('list' or 'grid')
|
|
28
29
|
* @returns Complete HTML template with default products
|
|
29
30
|
*/
|
|
30
31
|
export declare function getDefaultTemplate(layout?: Orientation): string;
|
|
31
32
|
/**
|
|
32
33
|
* Generates a complete block template with custom products.
|
|
34
|
+
* Includes both desktop and mobile product containers for grid layouts.
|
|
33
35
|
* @param products - Array of products to display
|
|
34
36
|
* @param layout - The layout orientation ('list' or 'grid')
|
|
35
37
|
* @param title - Title for the block
|
|
@@ -7,6 +7,8 @@ export type Orientation = 'list' | 'grid';
|
|
|
7
7
|
export interface PrepareProductRowsOptions {
|
|
8
8
|
/** Number of products per row (only for grid layout, defaults to 3) */
|
|
9
9
|
productsPerRow?: number;
|
|
10
|
+
/** Number of products per row on mobile (only for grid layout, defaults to 1) */
|
|
11
|
+
mobileProductsPerRow?: number;
|
|
10
12
|
/** Array defining order of card elements */
|
|
11
13
|
composition?: string[];
|
|
12
14
|
}
|
|
@@ -44,14 +46,21 @@ export declare const PLACEHOLDER_IMAGE = "https://email-static.useinsider.com/st
|
|
|
44
46
|
* @returns Sanitized HTTPS URL or placeholder
|
|
45
47
|
*/
|
|
46
48
|
export declare function sanitizeImageUrl(url: string | undefined | null): string;
|
|
47
|
-
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
49
|
+
export declare function getDefaultProducts(count?: number): RecommendationProduct[];
|
|
48
50
|
/**
|
|
49
51
|
* Creates the block template wrapper HTML for recommendation blocks.
|
|
50
|
-
* The template includes title placeholder and product
|
|
52
|
+
* The template includes title placeholder and both desktop/mobile product containers.
|
|
53
|
+
*
|
|
54
|
+
* The dual-container approach generates two `ins-recommendation-product-container` tables:
|
|
55
|
+
* - Desktop container: visible by default, hidden on mobile via CSS media query
|
|
56
|
+
* - Mobile container: hidden by default (`display: none`), shown on mobile
|
|
57
|
+
*
|
|
58
|
+
* Both share the `.ins-recommendation-product-container` class so existing selectors
|
|
59
|
+
* (spacing, background color, compiler rules) apply automatically to both.
|
|
51
60
|
* @param layout - The layout orientation ('list' or 'grid')
|
|
52
61
|
* @param instanceClass - Optional instance-specific class (e.g., 'ins-recommendation-v3-block-1')
|
|
53
62
|
* for CSS scoping per block instance. Must be included in the initial template HTML because
|
|
54
63
|
* Stripo's Angular rendering manages the class attribute and overwrites dynamic setAttribute changes.
|
|
55
|
-
* @returns HTML template string with {-{-TITLE-}-} and {-{-
|
|
64
|
+
* @returns HTML template string with {-{-TITLE-}-}, {-{-PRODUCT_ROWS-}-}, and {-{-MOBILE_PRODUCT_ROWS-}-} placeholders
|
|
56
65
|
*/
|
|
57
66
|
export declare function createBlockTemplate(layout?: Orientation, instanceClass?: string): string;
|
|
@@ -92,6 +92,12 @@ export interface RecommendationNodeConfig {
|
|
|
92
92
|
* Number of products per row (grid layout only)
|
|
93
93
|
*/
|
|
94
94
|
cardsInRow: number;
|
|
95
|
+
/**
|
|
96
|
+
* Number of products per row on mobile (grid layout only)
|
|
97
|
+
* Only applicable when layout is 'grid'
|
|
98
|
+
* @default 1
|
|
99
|
+
*/
|
|
100
|
+
mobileCardsInRow: number;
|
|
95
101
|
/**
|
|
96
102
|
* Horizontal spacing between product cards in pixels (grid layout only)
|
|
97
103
|
*/
|
|
@@ -46,6 +46,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
46
46
|
senderName: string;
|
|
47
47
|
subject: string;
|
|
48
48
|
};
|
|
49
|
+
savedModulesFolderName: string;
|
|
50
|
+
defaultModulesFolderName: string;
|
|
49
51
|
};
|
|
50
52
|
ui: {
|
|
51
53
|
showHeader: boolean;
|
|
@@ -141,6 +143,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
141
143
|
senderName: string;
|
|
142
144
|
subject: string;
|
|
143
145
|
};
|
|
146
|
+
savedModulesFolderName: string;
|
|
147
|
+
defaultModulesFolderName: string;
|
|
144
148
|
};
|
|
145
149
|
ui: {
|
|
146
150
|
showHeader: boolean;
|
|
@@ -236,6 +240,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
236
240
|
senderName: string;
|
|
237
241
|
subject: string;
|
|
238
242
|
};
|
|
243
|
+
savedModulesFolderName: string;
|
|
244
|
+
defaultModulesFolderName: string;
|
|
239
245
|
};
|
|
240
246
|
ui: {
|
|
241
247
|
showHeader: boolean;
|
|
@@ -331,6 +337,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
331
337
|
senderName: string;
|
|
332
338
|
subject: string;
|
|
333
339
|
};
|
|
340
|
+
savedModulesFolderName: string;
|
|
341
|
+
defaultModulesFolderName: string;
|
|
334
342
|
};
|
|
335
343
|
ui: {
|
|
336
344
|
showHeader: boolean;
|
|
@@ -426,6 +434,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
426
434
|
senderName: string;
|
|
427
435
|
subject: string;
|
|
428
436
|
};
|
|
437
|
+
savedModulesFolderName: string;
|
|
438
|
+
defaultModulesFolderName: string;
|
|
429
439
|
};
|
|
430
440
|
ui: {
|
|
431
441
|
showHeader: boolean;
|
|
@@ -521,6 +531,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
521
531
|
senderName: string;
|
|
522
532
|
subject: string;
|
|
523
533
|
};
|
|
534
|
+
savedModulesFolderName: string;
|
|
535
|
+
defaultModulesFolderName: string;
|
|
524
536
|
};
|
|
525
537
|
ui: {
|
|
526
538
|
showHeader: boolean;
|
|
@@ -616,6 +628,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
616
628
|
senderName: string;
|
|
617
629
|
subject: string;
|
|
618
630
|
};
|
|
631
|
+
savedModulesFolderName: string;
|
|
632
|
+
defaultModulesFolderName: string;
|
|
619
633
|
};
|
|
620
634
|
ui: {
|
|
621
635
|
showHeader: boolean;
|
|
@@ -711,6 +725,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
711
725
|
senderName: string;
|
|
712
726
|
subject: string;
|
|
713
727
|
};
|
|
728
|
+
savedModulesFolderName: string;
|
|
729
|
+
defaultModulesFolderName: string;
|
|
714
730
|
};
|
|
715
731
|
ui: {
|
|
716
732
|
showHeader: boolean;
|
|
@@ -806,6 +822,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
806
822
|
senderName: string;
|
|
807
823
|
subject: string;
|
|
808
824
|
};
|
|
825
|
+
savedModulesFolderName: string;
|
|
826
|
+
defaultModulesFolderName: string;
|
|
809
827
|
};
|
|
810
828
|
ui: {
|
|
811
829
|
showHeader: boolean;
|
|
@@ -901,6 +919,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
901
919
|
senderName: string;
|
|
902
920
|
subject: string;
|
|
903
921
|
};
|
|
922
|
+
savedModulesFolderName: string;
|
|
923
|
+
defaultModulesFolderName: string;
|
|
904
924
|
};
|
|
905
925
|
ui: {
|
|
906
926
|
showHeader: boolean;
|
|
@@ -996,6 +1016,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
996
1016
|
senderName: string;
|
|
997
1017
|
subject: string;
|
|
998
1018
|
};
|
|
1019
|
+
savedModulesFolderName: string;
|
|
1020
|
+
defaultModulesFolderName: string;
|
|
999
1021
|
};
|
|
1000
1022
|
ui: {
|
|
1001
1023
|
showHeader: boolean;
|
|
@@ -1091,6 +1113,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1091
1113
|
senderName: string;
|
|
1092
1114
|
subject: string;
|
|
1093
1115
|
};
|
|
1116
|
+
savedModulesFolderName: string;
|
|
1117
|
+
defaultModulesFolderName: string;
|
|
1094
1118
|
};
|
|
1095
1119
|
ui: {
|
|
1096
1120
|
showHeader: boolean;
|
|
@@ -1186,6 +1210,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1186
1210
|
senderName: string;
|
|
1187
1211
|
subject: string;
|
|
1188
1212
|
};
|
|
1213
|
+
savedModulesFolderName: string;
|
|
1214
|
+
defaultModulesFolderName: string;
|
|
1189
1215
|
};
|
|
1190
1216
|
ui: {
|
|
1191
1217
|
showHeader: boolean;
|
|
@@ -1281,6 +1307,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1281
1307
|
senderName: string;
|
|
1282
1308
|
subject: string;
|
|
1283
1309
|
};
|
|
1310
|
+
savedModulesFolderName: string;
|
|
1311
|
+
defaultModulesFolderName: string;
|
|
1284
1312
|
};
|
|
1285
1313
|
ui: {
|
|
1286
1314
|
showHeader: boolean;
|
|
@@ -1376,6 +1404,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1376
1404
|
senderName: string;
|
|
1377
1405
|
subject: string;
|
|
1378
1406
|
};
|
|
1407
|
+
savedModulesFolderName: string;
|
|
1408
|
+
defaultModulesFolderName: string;
|
|
1379
1409
|
};
|
|
1380
1410
|
ui: {
|
|
1381
1411
|
showHeader: boolean;
|
|
@@ -1471,6 +1501,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1471
1501
|
senderName: string;
|
|
1472
1502
|
subject: string;
|
|
1473
1503
|
};
|
|
1504
|
+
savedModulesFolderName: string;
|
|
1505
|
+
defaultModulesFolderName: string;
|
|
1474
1506
|
};
|
|
1475
1507
|
ui: {
|
|
1476
1508
|
showHeader: boolean;
|
|
@@ -1566,6 +1598,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1566
1598
|
senderName: string;
|
|
1567
1599
|
subject: string;
|
|
1568
1600
|
};
|
|
1601
|
+
savedModulesFolderName: string;
|
|
1602
|
+
defaultModulesFolderName: string;
|
|
1569
1603
|
};
|
|
1570
1604
|
ui: {
|
|
1571
1605
|
showHeader: boolean;
|
|
@@ -1661,6 +1695,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1661
1695
|
senderName: string;
|
|
1662
1696
|
subject: string;
|
|
1663
1697
|
};
|
|
1698
|
+
savedModulesFolderName: string;
|
|
1699
|
+
defaultModulesFolderName: string;
|
|
1664
1700
|
};
|
|
1665
1701
|
ui: {
|
|
1666
1702
|
showHeader: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = `.patch-session-container {
|
|
2
2
|
row-gap: 16px;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -24,7 +24,15 @@ ue-vh-patch.selected .patch-wrapper {
|
|
|
24
24
|
background-color: var(--guido-color-primary-100);
|
|
25
25
|
box-shadow: 0 0 0 1px var(--guido-color-primary-500);
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
.change-history-panel-wrapper .control-panel-header {
|
|
29
|
+
padding: 16px 0 16px 16px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.change-history-panel-wrapper .header-control-panel-label {
|
|
33
|
+
grid-area: 1 / 1 / 2 / 12;
|
|
34
|
+
}
|
|
27
35
|
`;
|
|
28
36
|
export {
|
|
29
|
-
|
|
37
|
+
n as default
|
|
30
38
|
};
|
|
@@ -60,7 +60,6 @@ ue-control-panel,
|
|
|
60
60
|
|
|
61
61
|
.control-panel-header {
|
|
62
62
|
grid-template-columns: repeat(12, 1fr);
|
|
63
|
-
padding: 16px 0px 16px 16px;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
.control-panel-header > * {
|
|
@@ -94,7 +93,9 @@ ue-control-panel,
|
|
|
94
93
|
.container.droppable-header-container ue-button:last-child {
|
|
95
94
|
margin-right: 0;
|
|
96
95
|
}
|
|
97
|
-
|
|
96
|
+
.container.droppable-header-container {
|
|
97
|
+
margin-top: 13px;
|
|
98
|
+
}
|
|
98
99
|
.secondary-control-group {
|
|
99
100
|
gap: 16px;
|
|
100
101
|
}
|
|
@@ -133,6 +134,21 @@ ue-label.accent-dot:after {
|
|
|
133
134
|
font-size: 13px;
|
|
134
135
|
}
|
|
135
136
|
|
|
137
|
+
.e2e-container-video-size {
|
|
138
|
+
grid-template-columns: 1fr !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.e2e-container-video-size .control-shadow-wrapper:not(ue-button) {
|
|
142
|
+
display: flex;
|
|
143
|
+
width: 100%;
|
|
144
|
+
justify-content: flex-end;
|
|
145
|
+
background-color: transparent !important;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.e2e-container-video-size .control-shadow-wrapper input {
|
|
149
|
+
background-color: var(--guido-color-gray-0);
|
|
150
|
+
}
|
|
151
|
+
|
|
136
152
|
.e2e-size,
|
|
137
153
|
.e2e-timer-size {
|
|
138
154
|
grid-auto-flow: row;
|
|
@@ -47,17 +47,18 @@ const n = `.esd-x,
|
|
|
47
47
|
display: none !important;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/*
|
|
51
|
-
.
|
|
52
|
-
|
|
50
|
+
/* Mobile layout: hide mobile container by default in editor */
|
|
51
|
+
.ins-recommendation-mobile-container {
|
|
52
|
+
display: none;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
/* Mobile layout: when Stripo mobile mode is active, swap containers */
|
|
56
|
+
.ue-mobile-mode .ins-recommendation-desktop-container {
|
|
57
|
+
display: none !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ue-mobile-mode .ins-recommendation-mobile-container {
|
|
61
|
+
display: table !important;
|
|
61
62
|
}
|
|
62
63
|
`;
|
|
63
64
|
export {
|
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.a67f307",
|
|
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",
|