@useinsider/guido 3.0.0-beta.7d3a300 → 3.0.0-beta.952fc1f
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/config/i18n/en/tooltips.json.js +1 -2
- package/dist/extensions/Blocks/Recommendation/block.js +56 -38
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -78
- package/dist/extensions/Blocks/Recommendation/controls/{layout/index.js → main/layoutOrientation.js} +35 -27
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +58 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +150 -64
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +198 -204
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +25 -8
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +21 -21
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +17 -17
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +134 -142
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +65 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +13 -13
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +35 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -27
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
- package/dist/extensions/Blocks/common-control.js +90 -41
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{layout/index.d.ts → main/layoutOrientation.d.ts} +3 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productCount.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +38 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +23 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +8 -18
- package/dist/src/extensions/Blocks/Recommendation/controls/syncInfoMessage.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/extensions/Blocks/common-control.d.ts +24 -2
- package/dist/static/styles/components/button.css.js +7 -13
- package/dist/static/styles/components/narrow-panel.css.js +0 -52
- package/dist/static/styles/components/wide-panel.css.js +1 -0
- package/dist/static/styles/customEditorStyle.css.js +9 -0
- package/package.json +3 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
package/dist/package.json.js
CHANGED
|
@@ -62,5 +62,6 @@ export declare enum RecommendationControlId {
|
|
|
62
62
|
CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control",
|
|
63
63
|
CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control",
|
|
64
64
|
CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
|
|
65
|
-
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control"
|
|
65
|
+
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
|
|
66
|
+
SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
|
|
66
67
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* // Or individual imports
|
|
10
10
|
* import { NameAlignControl, ButtonColorControl } from './controls';
|
|
11
11
|
*/
|
|
12
|
-
export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, } from './main';
|
|
12
|
+
export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, } from './main';
|
|
13
13
|
export * from './main/utils';
|
|
14
14
|
export { NameControls } from './name';
|
|
15
15
|
export { PriceControls } from './price';
|
|
@@ -21,5 +21,5 @@ export { ImageControls } from './image';
|
|
|
21
21
|
export { CustomAttributeControls } from './customAttribute';
|
|
22
22
|
export { SpacingControl, SPACING_CONTROL_ID } from './spacing';
|
|
23
23
|
export { CardBackgroundColorControl, CARD_BACKGROUND_COLOR_CONTROL_ID } from './cardBackground';
|
|
24
|
-
export { LayoutControl, LAYOUT_CONTROL_ID } from './layout';
|
|
25
24
|
export { RecommendationCardCompositionControl, COMPOSITION_CONTROL_BLOCK_ID } from './cardComposition';
|
|
25
|
+
export { SyncInfoMessageControl, SYNC_INFO_MESSAGE_CONTROL_ID } from './syncInfoMessage';
|
|
@@ -3,11 +3,13 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { AlgorithmControl, ALGORITHM_CONTROL_ID } from './algorithm';
|
|
4
4
|
import { CurrencyControl, CURRENCY_CONTROL_ID } from './currency';
|
|
5
5
|
import { FiltersControl, FILTERS_CONTROL_ID } from './filters';
|
|
6
|
+
import { LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID } from './layoutOrientation';
|
|
6
7
|
import { LocaleControl, LOCALE_CONTROL_ID } from './locale';
|
|
8
|
+
import { ProductCountControl, PRODUCT_COUNT_CONTROL_ID } from './productCount';
|
|
7
9
|
import { ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID } from './productLayout';
|
|
8
10
|
import { ShuffleControl, SHUFFLE_CONTROL_ID } from './shuffle';
|
|
9
11
|
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
10
|
-
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, };
|
|
12
|
+
export { AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, };
|
|
11
13
|
export * from './utils';
|
|
12
14
|
/**
|
|
13
15
|
* Main recommendation block control that composes all sub-controls
|
|
@@ -19,9 +21,11 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
19
21
|
private algorithmControl;
|
|
20
22
|
private localeControl;
|
|
21
23
|
private currencyControl;
|
|
24
|
+
private productCountControl;
|
|
22
25
|
private productLayoutControl;
|
|
23
26
|
private filtersControl;
|
|
24
27
|
private shuffleControl;
|
|
28
|
+
private layoutOrientationControl;
|
|
25
29
|
getId(): string;
|
|
26
30
|
getTemplate(): string;
|
|
27
31
|
onRender(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Layout Control
|
|
2
|
+
* Layout Orientation Control
|
|
3
3
|
*
|
|
4
4
|
* Manages recommendation block layout orientation
|
|
5
5
|
* Allows switching between grid and list layouts
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
10
10
|
import { CommonControl } from '../../../common-control';
|
|
11
11
|
import { type Orientation } from '../../templates';
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const LAYOUT_ORIENTATION_CONTROL_ID = "recommendation-layout-orientation-control";
|
|
13
13
|
/**
|
|
14
14
|
* Control for managing recommendation block layout orientation
|
|
15
15
|
* Allows switching between grid and list layouts
|
|
16
16
|
*/
|
|
17
|
-
export declare class
|
|
17
|
+
export declare class LayoutOrientationControl extends CommonControl {
|
|
18
18
|
private store;
|
|
19
19
|
private isChangingLayout;
|
|
20
20
|
getId(): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product Count Control
|
|
3
|
+
*
|
|
4
|
+
* Handles the "Number of Products" setting for the recommendation block.
|
|
5
|
+
* Extracted from ProductLayoutControl for single-responsibility.
|
|
6
|
+
*
|
|
7
|
+
* Changes to product count trigger a product refetch via Pinia store
|
|
8
|
+
* subscription (handled by the main RecommendationBlockControl coordinator).
|
|
9
|
+
*
|
|
10
|
+
* Configuration is stored via node config (persists with template).
|
|
11
|
+
*/
|
|
12
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
|
+
import { CommonControl } from '../../../common-control';
|
|
14
|
+
export declare const PRODUCT_COUNT_CONTROL_ID = "recommendation-product-count-control";
|
|
15
|
+
/**
|
|
16
|
+
* Control for configuring the number of products to display.
|
|
17
|
+
* Updates node config and triggers product refetch via store subscription.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ProductCountControl extends CommonControl {
|
|
20
|
+
private store;
|
|
21
|
+
getId(): string;
|
|
22
|
+
getTemplate(): string;
|
|
23
|
+
onRender(): void;
|
|
24
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
25
|
+
_setFormValues(): void;
|
|
26
|
+
_onProductCountChange(value: string): void;
|
|
27
|
+
_listenToFormUpdates(): void;
|
|
28
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Product Layout Control
|
|
3
3
|
*
|
|
4
|
-
* Handles product
|
|
5
|
-
* - Number of products to show
|
|
4
|
+
* Handles product grid/row configuration:
|
|
6
5
|
* - Products per row on desktop (hidden for list layout)
|
|
7
|
-
* -
|
|
6
|
+
* - Mobile Layout Optimization toggle (enables/disables mobile-specific layout)
|
|
7
|
+
* - Products per row on mobile (visible only when mobile layout is enabled)
|
|
8
8
|
* - Triggers product row regeneration on changes
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* When the mobile layout toggle is ON, only one "Products in One Row" counter
|
|
11
|
+
* is visible at a time — desktop or mobile — based on the editor's current
|
|
12
|
+
* preview device mode. Both counters are placed above the toggle.
|
|
13
|
+
*
|
|
14
|
+
* Note: "Number of Products" is handled by the separate ProductCountControl.
|
|
12
15
|
*
|
|
13
16
|
* Configuration is stored via node config (persists with template).
|
|
14
17
|
*/
|
|
@@ -16,8 +19,9 @@ import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
|
16
19
|
import { CommonControl } from '../../../common-control';
|
|
17
20
|
export declare const PRODUCT_LAYOUT_CONTROL_ID = "recommendation-product-layout-control";
|
|
18
21
|
/**
|
|
19
|
-
* Control for configuring product
|
|
20
|
-
* Includes
|
|
22
|
+
* Control for configuring product layout density.
|
|
23
|
+
* Includes desktop "products per row" counter, a mobile layout optimization
|
|
24
|
+
* toggle, and a mobile "products per row" counter (visible when toggle is on).
|
|
21
25
|
*/
|
|
22
26
|
export declare class ProductLayoutControl extends CommonControl {
|
|
23
27
|
private store;
|
|
@@ -29,24 +33,32 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
29
33
|
onDestroy(): void;
|
|
30
34
|
_setFormValues(): void;
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
33
|
-
* using Stripo's EditorStatePropertyType API.
|
|
36
|
+
* Returns true when the editor preview is in mobile mode.
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
_isMobilePreview(): boolean;
|
|
36
39
|
/**
|
|
37
|
-
* Updates counter visibility based on layout
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
40
|
+
* Updates counter visibility based on layout, mobileLayoutEnabled, and editor preview mode.
|
|
41
|
+
*
|
|
42
|
+
* Three mutually exclusive rows exist in the template:
|
|
43
|
+
* 1. "Products in One Row" — generic, shown when toggle is OFF
|
|
44
|
+
* 2. "Products in One Row on Desktop" — shown when toggle is ON + desktop preview
|
|
45
|
+
* 3. "Products in One Row on Mobile" — shown when toggle is ON + mobile preview
|
|
46
|
+
*
|
|
47
|
+
* Only one row is visible at a time. This avoids setUIEAttribute on hidden
|
|
48
|
+
* elements, which Stripo does not apply reliably.
|
|
41
49
|
*/
|
|
42
50
|
_updateProductsInRowVisibility(): void;
|
|
43
51
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
52
|
+
* Initializes the mobile layout toggle using the same pattern as shuffle.ts.
|
|
53
|
+
* Sets the initial UI attribute value from the node config.
|
|
54
|
+
*/
|
|
55
|
+
_initializeMobileLayoutToggle(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Handles mobile layout toggle change.
|
|
58
|
+
* When enabled: opts in to mobile layout, restores previous mobileCardsInRow.
|
|
59
|
+
* When disabled: snapshots current mobileCardsInRow, resets to 1, opts out.
|
|
47
60
|
*/
|
|
48
|
-
|
|
49
|
-
_onProductCountChange(value: string): void;
|
|
61
|
+
_onMobileLayoutToggleChange(enabled: boolean): void;
|
|
50
62
|
_onProductsInRowChange(value: number): void;
|
|
51
63
|
_onMobileCardsInRowChange(value: number): void;
|
|
52
64
|
_regenerateProductRows(): void;
|
|
@@ -54,7 +66,13 @@ export declare class ProductLayoutControl extends CommonControl {
|
|
|
54
66
|
_listenToFormUpdates(): void;
|
|
55
67
|
/**
|
|
56
68
|
* Subscribe to store changes to update visibility when layout changes
|
|
57
|
-
* This is still needed because layout changes come from
|
|
69
|
+
* This is still needed because layout changes come from LayoutOrientationControl
|
|
58
70
|
*/
|
|
59
71
|
_listenStateUpdates(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Subscribe to editor preview mode changes (desktop ↔ mobile).
|
|
74
|
+
* When the user switches preview mode and mobile layout is enabled,
|
|
75
|
+
* we swap which "Products in One Row" counter is visible.
|
|
76
|
+
*/
|
|
77
|
+
_listenEditorModeChanges(): void;
|
|
60
78
|
}
|
|
@@ -64,8 +64,10 @@ export interface RegenerateProductRowsOptions {
|
|
|
64
64
|
* Used when mobile-specific settings change (mobileCardsInRow)
|
|
65
65
|
* or when the desktop container is regenerated (to keep both in sync).
|
|
66
66
|
*
|
|
67
|
-
* For list layout:
|
|
68
|
-
* For grid layout:
|
|
67
|
+
* For list layout: clears the mobile row content (list rows are inherently responsive).
|
|
68
|
+
* For grid layout with mobileLayoutEnabled OFF: clears the mobile row content.
|
|
69
|
+
* For grid layout with mobileLayoutEnabled ON: rebuilds the full mobile row
|
|
70
|
+
* structure (<td><table>...products...</table></td>) in a single operation.
|
|
69
71
|
*/
|
|
70
72
|
export declare function regenerateMobileProductRows(options: Omit<RegenerateProductRowsOptions, 'afterRegenerate'>): void;
|
|
71
73
|
/**
|
|
@@ -5,12 +5,23 @@
|
|
|
5
5
|
* Rules are injected into the document's stylesheet via modifyCss
|
|
6
6
|
* so they appear in the compiled HTML export.
|
|
7
7
|
*/
|
|
8
|
-
import type { ImmutableCssNode } from '@stripoinc/ui-editor-extensions';
|
|
8
|
+
import type { ImmutableCssNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
9
9
|
import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
10
10
|
/** CSS class for desktop product container */
|
|
11
11
|
export declare const CSS_CLASS_DESKTOP_CONTAINER = "ins-recommendation-desktop-container";
|
|
12
12
|
/** CSS class for mobile product container */
|
|
13
13
|
export declare const CSS_CLASS_MOBILE_CONTAINER = "ins-recommendation-mobile-container";
|
|
14
|
+
/** CSS class that opts a block out of the mobile layout container swap */
|
|
15
|
+
export declare const CSS_CLASS_NO_MOBILE_LAYOUT = "ins-recommendation-no-mobile-layout";
|
|
16
|
+
interface HtmlModifierApi {
|
|
17
|
+
getDocumentModifier: () => {
|
|
18
|
+
modifyHtml: (node: ImmutableHtmlNode) => {
|
|
19
|
+
setClass: (cls: string) => void;
|
|
20
|
+
removeClass: (cls: string) => void;
|
|
21
|
+
};
|
|
22
|
+
apply: (desc: ModificationDescription) => void;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
14
25
|
interface CssModifierApi {
|
|
15
26
|
getDocumentRootCssNode: () => ImmutableCssNode | null;
|
|
16
27
|
getDocumentModifier: () => {
|
|
@@ -26,4 +37,15 @@ interface CssModifierApi {
|
|
|
26
37
|
* Follows the same pattern as textTrim's _ensureCssRulesExist().
|
|
27
38
|
*/
|
|
28
39
|
export declare function ensureMobileCssRulesExist(api: CssModifierApi): void;
|
|
40
|
+
/**
|
|
41
|
+
* Checks if a block element has the mobile layout opt-out class.
|
|
42
|
+
* Read-side companion to setMobileLayoutOptOut().
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasMobileLayoutOptOut(blockElement: ImmutableHtmlNode): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Adds or removes the mobile layout opt-out class on a block element.
|
|
47
|
+
* When optOut is true, the block keeps the desktop container visible on mobile.
|
|
48
|
+
* When optOut is false, the block follows the default mobile container swap.
|
|
49
|
+
*/
|
|
50
|
+
export declare function setMobileLayoutOptOut(api: HtmlModifierApi, blockElement: ImmutableHtmlNode, optOut: boolean): void;
|
|
29
51
|
export {};
|
|
@@ -5,8 +5,9 @@
|
|
|
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
|
|
9
|
-
*
|
|
8
|
+
* Desktop spacing controls are always visible when applicable (grid layout).
|
|
9
|
+
* Mobile spacing controls are visible only when mobileLayoutEnabled is true
|
|
10
|
+
* in the node config (controlled by the Mobile Layout Optimization toggle).
|
|
10
11
|
*
|
|
11
12
|
* Configuration is stored via node config (persists with template).
|
|
12
13
|
* Actual spacing is applied to DOM elements via inline styles.
|
|
@@ -18,7 +19,8 @@ export declare const SPACING_CONTROL_ID = "recommendation-spacing-control";
|
|
|
18
19
|
* Control for managing spacing between product cards
|
|
19
20
|
* - Column spacing: horizontal gap between cards in the same row
|
|
20
21
|
* - Row spacing: vertical gap between different rows
|
|
21
|
-
* - Separate controls for desktop and mobile
|
|
22
|
+
* - Separate controls for desktop and mobile
|
|
23
|
+
* - Mobile controls visibility driven by mobileLayoutEnabled config
|
|
22
24
|
*/
|
|
23
25
|
export declare class SpacingControl extends CommonControl {
|
|
24
26
|
private store;
|
|
@@ -29,18 +31,11 @@ export declare class SpacingControl extends CommonControl {
|
|
|
29
31
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
30
32
|
onDestroy(): void;
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
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.
|
|
34
|
+
* Updates spacing control visibility based on layout orientation and mobileLayoutEnabled.
|
|
39
35
|
* - List layout: hide column spacing (products are full-width), hide ALL mobile
|
|
40
36
|
* spacing controls (list is responsive — single row spacing applies to both views)
|
|
41
|
-
* - Desktop
|
|
42
|
-
* - Mobile
|
|
43
|
-
* - 1 product per row: hide column spacing (no gap between single column)
|
|
37
|
+
* - Desktop controls: always visible for grid layout (column spacing needs 2+ per row)
|
|
38
|
+
* - Mobile controls: visible when mobileLayoutEnabled is true (grid only)
|
|
44
39
|
*/
|
|
45
40
|
_updateSpacingVisibility(): void;
|
|
46
41
|
/**
|
|
@@ -108,9 +103,4 @@ export declare class SpacingControl extends CommonControl {
|
|
|
108
103
|
* Updates spacing visibility when layout changes via the layout control
|
|
109
104
|
*/
|
|
110
105
|
_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;
|
|
116
106
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CommonControl } from '../../common-control';
|
|
2
|
+
import { RecommendationControlId } from '../constants';
|
|
3
|
+
export declare const SYNC_INFO_MESSAGE_CONTROL_ID = RecommendationControlId.SYNC_INFO_MESSAGE;
|
|
4
|
+
/**
|
|
5
|
+
* Static info message control for the product name sub-block settings panel.
|
|
6
|
+
*
|
|
7
|
+
* Follows the same pattern as getMigrationBannerHtml:
|
|
8
|
+
* - Direct HTML template with UIElementType.ICON + text
|
|
9
|
+
* - CSS-class-based styling (defined in recommendation.css)
|
|
10
|
+
* - Repositioned above tabs via DOM manipulation in onRender()
|
|
11
|
+
* - Cleaned up in onDestroy() since the element lives outside Stripo's managed area
|
|
12
|
+
*/
|
|
13
|
+
export declare class SyncInfoMessageControl extends CommonControl {
|
|
14
|
+
private _repositionedElement;
|
|
15
|
+
getId(): string;
|
|
16
|
+
getTemplate(): string;
|
|
17
|
+
onRender(): void;
|
|
18
|
+
onDestroy(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Moves the info message from inside the Settings tab content
|
|
21
|
+
* to above the tab bar in the DOM tree.
|
|
22
|
+
*
|
|
23
|
+
* DOM structure (Stripo internals):
|
|
24
|
+
* ue-control-panel
|
|
25
|
+
* div.control-panel-header-wrapper
|
|
26
|
+
* div.control-panel-header ← title bar (X, title, undo)
|
|
27
|
+
* ue-tabs-header.control-panel-tabs ← tab bar (Settings | Styles)
|
|
28
|
+
* div.control-panel-content-wrapper ← tab content (where our control renders)
|
|
29
|
+
*
|
|
30
|
+
* We insert the message between the title bar and the tab bar.
|
|
31
|
+
* The element reference is stored so onDestroy() can remove it.
|
|
32
|
+
*/
|
|
33
|
+
private _repositionAboveTabs;
|
|
34
|
+
}
|
|
@@ -106,6 +106,19 @@ export interface RecommendationNodeConfig {
|
|
|
106
106
|
* Vertical spacing between product rows in pixels
|
|
107
107
|
*/
|
|
108
108
|
rowSpacing: number;
|
|
109
|
+
/**
|
|
110
|
+
* Whether mobile layout optimization is enabled
|
|
111
|
+
* When enabled, shows mobile-specific product row configuration
|
|
112
|
+
* When disabled, adds opt-out CSS class to prevent mobile container swap
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
mobileLayoutEnabled: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Snapshot of mobileCardsInRow before disabling mobile layout
|
|
118
|
+
* Used to restore the previous value when re-enabling
|
|
119
|
+
* @default 1
|
|
120
|
+
*/
|
|
121
|
+
previousMobileCardsInRow: number;
|
|
109
122
|
/**
|
|
110
123
|
* Horizontal spacing between product cards on mobile in pixels (grid layout only)
|
|
111
124
|
*/
|
|
@@ -15,7 +15,7 @@ export interface NodeWithGetStyle {
|
|
|
15
15
|
}
|
|
16
16
|
/** Interface for nodes with parent method */
|
|
17
17
|
export interface NodeWithParent {
|
|
18
|
-
parent: () => ImmutableHtmlNode |
|
|
18
|
+
parent: () => ImmutableHtmlNode | null;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Type guard to check if a node has getStyle method
|
|
@@ -38,13 +38,13 @@ export declare function isTdNode(node: unknown): node is ImmutableHtmlNode & Nod
|
|
|
38
38
|
* @param property - The CSS property name
|
|
39
39
|
* @returns The style value or null if not accessible
|
|
40
40
|
*/
|
|
41
|
-
export declare function safeGetStyle(node: ImmutableHtmlNode | null
|
|
41
|
+
export declare function safeGetStyle(node: ImmutableHtmlNode | null, property: string): string | null | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Safely retrieves the parent element of a node
|
|
44
44
|
* @param node - The node to get the parent from
|
|
45
45
|
* @returns The parent node or null if not accessible
|
|
46
46
|
*/
|
|
47
|
-
export declare function safeGetParent(node: ImmutableHtmlNode | null
|
|
47
|
+
export declare function safeGetParent(node: ImmutableHtmlNode | null): ImmutableHtmlNode | null;
|
|
48
48
|
/**
|
|
49
49
|
* Safely retrieves the tag name from a node.
|
|
50
50
|
* Handles both standard DOM tagName property and Stripo's getTagName() method.
|
|
@@ -9,7 +9,16 @@ interface TextInputProps {
|
|
|
9
9
|
interface LabelProps {
|
|
10
10
|
text: string;
|
|
11
11
|
name?: string;
|
|
12
|
-
|
|
12
|
+
hint?: string;
|
|
13
|
+
}
|
|
14
|
+
interface MessageProps {
|
|
15
|
+
name?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
}
|
|
18
|
+
interface InfoMessageProps {
|
|
19
|
+
name: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
type?: string;
|
|
13
22
|
}
|
|
14
23
|
interface IconProps {
|
|
15
24
|
src: string;
|
|
@@ -77,7 +86,20 @@ export declare abstract class CommonControl extends Control {
|
|
|
77
86
|
* @returns true if block instance changed, false otherwise
|
|
78
87
|
*/
|
|
79
88
|
protected handleBlockInstanceChange(updateUI: () => void): boolean;
|
|
80
|
-
_GuLabel({ text, name }: LabelProps): string;
|
|
89
|
+
_GuLabel({ text, name, hint }: LabelProps): string;
|
|
90
|
+
_GuMessage({ name, type }: MessageProps): string;
|
|
91
|
+
/**
|
|
92
|
+
* Returns template HTML for an info message with an optional icon.
|
|
93
|
+
* Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
|
|
94
|
+
* Pair with _setInfoMessageValue() in onRender() to set the text content.
|
|
95
|
+
*/
|
|
96
|
+
_GuOnPageMessage({ name, icon, type }: InfoMessageProps): string;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the info message value with the pre-registered icon.
|
|
99
|
+
* Use in onRender() — reads the icon's outerHTML from the hidden store
|
|
100
|
+
* and combines it with the text in Stripo's alert-message layout.
|
|
101
|
+
*/
|
|
102
|
+
_setInfoMessageValue(name: string, text: string): void;
|
|
81
103
|
_GuToggle(name: string): string;
|
|
82
104
|
_GuSelectItem({ text, value }: {
|
|
83
105
|
text: string;
|
|
@@ -99,12 +99,18 @@ ue-check-button.checked:not(.flat-white) input:checked + label .icon-button {
|
|
|
99
99
|
color: var(--guido-color-primary-500);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
ue-select.full-width .button {
|
|
103
|
+
border: none !important;
|
|
104
|
+
background-color: var(--guido-color-neutral-200) !important;
|
|
105
|
+
color: var(--guido-color-neutral-800) !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
ue-select.full-width .button .icon-button {
|
|
103
109
|
color: var(--guido-color-gray-600) !important;
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
ue-select.full-width .button:hover:not(:disabled,.disabled) {
|
|
107
|
-
background-color: var(--guido-color-
|
|
113
|
+
background-color: var(--guido-color-neutral-100) !important;
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
ue-color {
|
|
@@ -124,18 +130,6 @@ ue-select-text-input .select-text-input-toggle .button {
|
|
|
124
130
|
justify-content: center;
|
|
125
131
|
background-color: transparent !important;
|
|
126
132
|
}
|
|
127
|
-
|
|
128
|
-
.control-shadow-wrapper,
|
|
129
|
-
ue-button:not(.no-shadow,.flat-white),
|
|
130
|
-
ue-toggle:not(.no-shadow,.flat-white),
|
|
131
|
-
:is(ue-popover-toggler,ue-toggle-icon-picker,ue-emoji-toggle),
|
|
132
|
-
.button-group,
|
|
133
|
-
ue-counter:not(.no-shadow),
|
|
134
|
-
:is(ue-select,ue-mergetags,ue-font-family-select):not(.no-shadow),
|
|
135
|
-
ue-check-button:not(.no-shadow,.flat-white) {
|
|
136
|
-
background: none;
|
|
137
|
-
padding: 0;
|
|
138
|
-
}
|
|
139
133
|
`;
|
|
140
134
|
export {
|
|
141
135
|
o as default
|
|
@@ -28,58 +28,6 @@ ue-stripe-thumb:hover:not(.disabled),
|
|
|
28
28
|
border-color: var(--guido-color-primary-500);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/* Module search — initial */
|
|
32
|
-
.module-search-container {
|
|
33
|
-
background-color: var(--guido-color-gray-0);
|
|
34
|
-
border: 1px solid var(--guido-color-gray-300);
|
|
35
|
-
border-radius: 4px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.module-search-container .service-element {
|
|
39
|
-
background-color: unset;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.module-filter-toggle {
|
|
43
|
-
top: -1px !important;
|
|
44
|
-
right: -1px !important;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.module-filter-toggle > .button,
|
|
48
|
-
.module-search-container:hover .module-filter-toggle > .button {
|
|
49
|
-
border: none;
|
|
50
|
-
background: transparent;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Module search — hover */
|
|
54
|
-
.module-search-container:has(.module-search-chip-input:hover) {
|
|
55
|
-
border-color: var(--guido-color-primary-500);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.module-search-container .module-search-chip-input .service-element:hover {
|
|
59
|
-
background-color: var(--guido-color-gray-0);
|
|
60
|
-
border-radius: 4px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.module-search-container .module-filter-toggle:hover > .button {
|
|
64
|
-
background-color: var(--guido-color-gray-1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Module search — selected (.on) */
|
|
68
|
-
.module-search-container:has(.module-search-chip-input.on),
|
|
69
|
-
.module-search-container:has(.module-search-chip-input.on):hover {
|
|
70
|
-
border-color: var(--guido-color-primary-500);
|
|
71
|
-
box-shadow: 0 0 0 3px var(--guido-color-primary-200) !important;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.module-search-container .module-search-chip-input.on .input-section {
|
|
75
|
-
background-color: unset;
|
|
76
|
-
box-shadow: unset;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.module-categories-list .menu-item {
|
|
80
|
-
padding: 8px 20px !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
31
|
.modules-layout-wrapper {
|
|
84
32
|
padding: 0 16px 16px;
|
|
85
33
|
grid-row-gap: 16px;
|
|
@@ -87,6 +87,15 @@ const n = `.esd-x,
|
|
|
87
87
|
.ue-mobile-mode .ins-recommendation-list-layout .product-info-cell {
|
|
88
88
|
padding: 5px 8px !important;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/* Mobile layout opt-out: when toggle is OFF, keep desktop container visible in mobile mode */
|
|
92
|
+
.ue-mobile-mode .ins-recommendation-no-mobile-layout .ins-recommendation-desktop-container {
|
|
93
|
+
display: table !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ue-mobile-mode .ins-recommendation-no-mobile-layout .ins-recommendation-mobile-container {
|
|
97
|
+
display: none !important;
|
|
98
|
+
}
|
|
90
99
|
`;
|
|
91
100
|
export {
|
|
92
101
|
n as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.952fc1f",
|
|
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
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
35
|
+
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
36
|
"@useinsider/design-system-vue": "0.14.28",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.54.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../common-control';
|
|
3
|
-
export declare const CARD_BACKGROUND_COLOR_CONTROL_ID = "recommendation-card-background-color-control";
|
|
4
|
-
/**
|
|
5
|
-
* Control for managing recommendation card background color
|
|
6
|
-
* This control is displayed in the Styles tab
|
|
7
|
-
*/
|
|
8
|
-
export declare class CardBackgroundColorControl extends CommonControl {
|
|
9
|
-
getId(): string;
|
|
10
|
-
getTemplate(): string;
|
|
11
|
-
onRender(): void;
|
|
12
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
13
|
-
_setFormValues(): void;
|
|
14
|
-
/**
|
|
15
|
-
* Reads the current background color from the first product card wrapper
|
|
16
|
-
* @returns The background color value or 'transparent' if not found
|
|
17
|
-
*/
|
|
18
|
-
_getCurrentCardBackgroundColor(): string;
|
|
19
|
-
/**
|
|
20
|
-
* Handles card background color changes
|
|
21
|
-
* Applies the color to all product card wrapper elements
|
|
22
|
-
*/
|
|
23
|
-
_onCardBackgroundColorChange(color: string): void;
|
|
24
|
-
_listenToFormUpdates(): void;
|
|
25
|
-
}
|
package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../common-control';
|
|
3
|
-
/**
|
|
4
|
-
* Control for setting text after Omnibus Discount value
|
|
5
|
-
*/
|
|
6
|
-
export declare class OmnibusDiscountTextAfterControl extends CommonControl {
|
|
7
|
-
getId(): string;
|
|
8
|
-
getTemplate(): string;
|
|
9
|
-
onRender(): void;
|
|
10
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
11
|
-
_setFormValues(): void;
|
|
12
|
-
_getCurrentText(): string;
|
|
13
|
-
_onTextChange(newText: string): void;
|
|
14
|
-
_listenToFormUpdates(): void;
|
|
15
|
-
}
|