@useinsider/guido 3.17.0 → 3.18.0
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 +6 -5
- package/dist/@types/config/schemas.js +7 -6
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +82 -76
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useModuleRepair.js +33 -0
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +30 -29
- package/dist/composables/useStripo.js +15 -15
- package/dist/composables/useSyncModuleExtractor.js +15 -13
- package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +3 -1
- package/dist/extensions/Blocks/Items/block.js +118 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +25 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +175 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +69 -30
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useModuleRepair.d.ts +18 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
- package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +35 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +43 -0
- package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +176 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +17 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/itemsCurrencyRepair.js +39 -0
- package/dist/utils/pairProductVariables.js +58 -58
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
- package/dist/composables/useModuleDynamicContentRepair.js +0 -37
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -13
package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RrsStrategy } from '@@/Types/recommendation';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
strategy: RrsStrategy;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
+
type __VLS_TypePropsToOption<T> = {
|
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
+
} : {
|
|
12
|
+
type: import('vue').PropType<T[K]>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -99,6 +99,7 @@ export declare const useConfig: () => {
|
|
|
99
99
|
autosave: boolean;
|
|
100
100
|
allowlistEnabled: boolean;
|
|
101
101
|
linkTrackingIds: boolean;
|
|
102
|
+
reusableRecommendationStrategy: boolean;
|
|
102
103
|
};
|
|
103
104
|
blocks: {
|
|
104
105
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -233,6 +234,7 @@ export declare const useConfig: () => {
|
|
|
233
234
|
autosave: boolean;
|
|
234
235
|
allowlistEnabled: boolean;
|
|
235
236
|
linkTrackingIds: boolean;
|
|
237
|
+
reusableRecommendationStrategy: boolean;
|
|
236
238
|
} | null>;
|
|
237
239
|
blocks: import("vue").ComputedRef<{
|
|
238
240
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModuleAddData, ModuleModifier } from '@@/Types/stripo';
|
|
2
|
+
export declare const UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY = "dynamic-content.unresolved-attributes-on-drop";
|
|
3
|
+
/**
|
|
4
|
+
* Repairs saved modules as they are dropped or copied into the editor, in one pass
|
|
5
|
+
* over the module HTML. Two independent repairs run through a single write-back:
|
|
6
|
+
*
|
|
7
|
+
* - Dynamic content: saved modules serialize merge-tag chips by their display label
|
|
8
|
+
* (`{{ Phone Number }}`); this maps them back to their canonical token
|
|
9
|
+
* (`{{phone_number}}`) using the account's dynamic-content list.
|
|
10
|
+
* - Items currency: v2 Items blocks can carry price `data-curency` /
|
|
11
|
+
* `data-currency_symbol` attrs that drifted from their `esd-ext-config`; these are
|
|
12
|
+
* healed from config (the export contract reads those exact attrs).
|
|
13
|
+
*
|
|
14
|
+
* Wired into Stripo via the `onModuleAdd` init callback (see `useStripo`).
|
|
15
|
+
*/
|
|
16
|
+
export declare const useModuleRepair: () => {
|
|
17
|
+
handleModuleAdd: (data: ModuleAddData, modifier: ModuleModifier) => void;
|
|
18
|
+
};
|
|
@@ -18,6 +18,7 @@ export declare const useRecommendation: () => {
|
|
|
18
18
|
getRecommendationCampaignData: (id: string) => CampaignData;
|
|
19
19
|
buildCampaignUrl: (campaignId: string, overrides?: {
|
|
20
20
|
strategy: string;
|
|
21
|
+
strategyId: string;
|
|
21
22
|
language: string;
|
|
22
23
|
currencyCode: string;
|
|
23
24
|
size: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SyncModuleExtractResult } from '@@/Types/events';
|
|
2
|
+
export declare const SYNC_MODULE_CLASS = "esd-synchronizable-module";
|
|
3
|
+
export declare const SYNC_MODULE_SELECTOR = ".esd-synchronizable-module";
|
|
2
4
|
export declare const useSyncModuleExtractor: () => {
|
|
3
5
|
extractSyncModuleData: (html: string) => SyncModuleExtractResult;
|
|
4
6
|
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare function extractTitleText(block: Element): string;
|
|
2
|
+
/**
|
|
3
|
+
* Fallback for legacy configs that carry no `p_recommendation_title` variable:
|
|
4
|
+
* the rendered HTML decides. A missing or `display: none` title container means
|
|
5
|
+
* the user never saw a title, so the migrated block keeps it toggled off.
|
|
6
|
+
* @param block - The legacy recommendation block element
|
|
7
|
+
* @returns True when the legacy block renders a visible title
|
|
8
|
+
*/
|
|
9
|
+
export declare function hasVisibleTitle(block: Element): boolean;
|
|
2
10
|
/**
|
|
3
11
|
* Card background lives on either the block (`bgcolor`/`style`) or per-card
|
|
4
12
|
* cells (`.product-card`). Returns empty string when no background is set —
|
|
@@ -8,5 +8,6 @@ export declare const ACADEMY_LINKS: {
|
|
|
8
8
|
readonly EMAIL_EDITOR: "https://academy.insiderone.com/docs/email-drag-and-drop-editor";
|
|
9
9
|
readonly GLOBAL_UNSUBSCRIBE: "https://academy.insiderone.com/docs/global-unsubscribe-preference-center";
|
|
10
10
|
readonly AMP_FOR_EMAILS: "https://academy.insiderone.com/docs/amp-for-emails";
|
|
11
|
+
readonly EMAIL_RECOMMENDATION_BLOCK: "https://academy.insiderone.com/docs/new-editor-email-recommendation-block";
|
|
11
12
|
};
|
|
12
13
|
export type AcademyLinkKey = keyof typeof ACADEMY_LINKS;
|
package/dist/src/enums/date.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
|
+
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
|
+
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const QUERY_PARAMS: {
|
|
8
10
|
CLIENT_ID: string;
|
|
@@ -16,6 +16,10 @@ export declare const BLOCK_ID: BlockId;
|
|
|
16
16
|
* - Onboarding support
|
|
17
17
|
*/
|
|
18
18
|
export declare class ItemsBlock extends Block {
|
|
19
|
+
/** Block instances whose currency attrs were already self-healed this session (SD-147588 — undo-safe). */
|
|
20
|
+
private _currencyHealed;
|
|
21
|
+
/** blockInstanceIds already claimed by a live block this session (SD-147588 collision detection). */
|
|
22
|
+
private _seenInstanceIds;
|
|
19
23
|
getId(): string;
|
|
20
24
|
getIcon(): string;
|
|
21
25
|
getBlockCompositionType(): BlockCompositionType;
|
|
@@ -42,4 +46,35 @@ export declare class ItemsBlock extends Block {
|
|
|
42
46
|
* relies on this td-level fallback in pairProductVariables.
|
|
43
47
|
*/
|
|
44
48
|
private _stampProductTdDomAttributes;
|
|
49
|
+
/**
|
|
50
|
+
* Whether a currency self-heal pass should run for this block (SD-147588). The only gate here is
|
|
51
|
+
* once-per-session: heal each instance at most once, so the auto-fix can't fight undo (undo
|
|
52
|
+
* re-drifts the attr, which would otherwise re-trigger the heal forever). The position-vs-symbol
|
|
53
|
+
* authority split lives in `_reconcileCurrencyDomAttributes` — position is always authoritative,
|
|
54
|
+
* the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
|
|
55
|
+
* on symbol customization here, or a default-symbol block with a toggled location never heals.
|
|
56
|
+
*/
|
|
57
|
+
private _shouldReconcileCurrency;
|
|
58
|
+
/** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
|
|
59
|
+
private _markCurrencyHealed;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves the id for a just-created block to one that is unique per live instance.
|
|
62
|
+
* A saved module serializes its blockInstanceId, so every re-drop of the same module
|
|
63
|
+
* arrives with an id already owned by a live instance — reusing it collides both the
|
|
64
|
+
* currency heal guard and settings-panel switch detection. Mint a fresh id on absence
|
|
65
|
+
* or collision, otherwise keep the existing one. Registers the result as claimed.
|
|
66
|
+
*/
|
|
67
|
+
private _resolveInstanceId;
|
|
68
|
+
/**
|
|
69
|
+
* Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
|
|
70
|
+
* attrs drifted (e.g. a location toggle before the sync fix) self-heals to match the editor.
|
|
71
|
+
* Config is the source of truth — never derive from visible text.
|
|
72
|
+
*
|
|
73
|
+
* Authority split lives in `currencyAttrTargets` (SD-147588) — position only when a location
|
|
74
|
+
* is recorded, symbol only when customized — so this heal and the module-drop repair can't drift.
|
|
75
|
+
*
|
|
76
|
+
* Returns true only when an attr actually changed, so the caller can skip an empty apply that
|
|
77
|
+
* would otherwise re-trigger onDocumentChanged and loop.
|
|
78
|
+
*/
|
|
79
|
+
private _reconcileCurrencyDomAttributes;
|
|
45
80
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single owner for the Items price currency export contract (SD-147588).
|
|
3
|
+
*
|
|
4
|
+
* `data-curency` is deliberately misspelled (one `r`) — it is the attribute the
|
|
5
|
+
* server-side export transform (pairProductVariables) actually reads, so every
|
|
6
|
+
* layer that writes it and the live reader (template, controls, block self-heal,
|
|
7
|
+
* pairProductVariables) MUST go through these constants. A typo fix or mapping change
|
|
8
|
+
* in one of them would otherwise silently break sync with the others and ship the wrong
|
|
9
|
+
* currency position/token to the inbox. Mirrors the Recommendation block's `CURRENCY_ATTR`.
|
|
10
|
+
*
|
|
11
|
+
* Exception: the legacy migrator reads the raw misspelled string on purpose — it parses
|
|
12
|
+
* old templates frozen with that exact attr name, so it must NOT follow a future rename here.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ITEMS_CURRENCY_ATTR: {
|
|
15
|
+
readonly POSITION: "data-curency";
|
|
16
|
+
readonly SYMBOL: "data-currency_symbol";
|
|
17
|
+
};
|
|
18
|
+
/** Currency location select value `'1'` = after (price then symbol), anything else = before. */
|
|
19
|
+
export declare function currencyPositionFromLocation(location: string | undefined): 'after' | 'before';
|
|
20
|
+
/**
|
|
21
|
+
* Whether a currency symbol is a partner customization vs the 'USD' default sentinel (SD-144644).
|
|
22
|
+
* The default value means "use the catalog currency", so it is treated as NOT customized — the one
|
|
23
|
+
* rule shared by the export transform (pairProductVariables) and the block self-heal, kept here so
|
|
24
|
+
* the two layers can never drift. Trims first so a whitespace-only value is not read as custom.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isCustomCurrencySymbol(symbol: string | null | undefined): boolean;
|
|
27
|
+
export interface CurrencyAttrTargets {
|
|
28
|
+
/** Desired `data-curency`; `undefined` = leave the DOM attr as-is (no location recorded). */
|
|
29
|
+
position?: 'before' | 'after';
|
|
30
|
+
/** Desired `data-currency_symbol`; `undefined` = leave it (empty / the 'USD' sentinel). */
|
|
31
|
+
symbol?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The single authority rule for which price currency attrs a config wants written,
|
|
35
|
+
* shared by the block self-heal (Items/block.ts) and the module-drop repair
|
|
36
|
+
* (itemsCurrencyRepair) so the two can never drift (SD-147588). Position is authoritative
|
|
37
|
+
* only when a location is explicitly recorded (an absent value is "unknown", not 'before');
|
|
38
|
+
* the symbol is written only for a custom value (never the 'USD' default sentinel).
|
|
39
|
+
*/
|
|
40
|
+
export declare function currencyAttrTargets(config: {
|
|
41
|
+
priceCurrencyLocation?: string;
|
|
42
|
+
priceCurrencySymbol?: string;
|
|
43
|
+
}): CurrencyAttrTargets;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block root selector — the container Stripo stamps on every v2 Items block.
|
|
3
|
+
* Legacy (`.esd-cart-items-block` &co.) is deliberately out of scope: it is
|
|
4
|
+
* normalized to v2 by `itemsBlockMigrator` at template load.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ITEMS_BLOCK_SELECTOR = ".items-block-v2";
|
|
@@ -10,5 +10,6 @@ export declare enum RecommendationBlockId {
|
|
|
10
10
|
OMNIBUS_PRICE = "recommendation-block-omnibus-price",
|
|
11
11
|
OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
|
|
12
12
|
IMAGE = "recommendation-block-image",
|
|
13
|
-
CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute"
|
|
13
|
+
CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute",
|
|
14
|
+
TITLE = "recommendation-block-title"
|
|
14
15
|
}
|
|
@@ -65,5 +65,12 @@ export declare enum RecommendationControlId {
|
|
|
65
65
|
CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
|
|
66
66
|
CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
|
|
67
67
|
CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
|
|
68
|
+
TITLE_ALIGN = "recommendation-block-title-align-control",
|
|
69
|
+
TITLE_BACKGROUND = "recommendation-block-title-background-control",
|
|
70
|
+
TITLE_COLOR = "recommendation-block-title-color-control",
|
|
71
|
+
TITLE_FONT_FAMILY = "recommendation-block-title-font-family-control",
|
|
72
|
+
TITLE_PADDINGS = "recommendation-block-title-paddings-control",
|
|
73
|
+
TITLE_SIZE = "recommendation-block-title-size-control",
|
|
74
|
+
TITLE_STYLE = "recommendation-block-title-style-control",
|
|
68
75
|
SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
|
|
69
76
|
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* - Merging partial updates with existing config
|
|
9
9
|
*/
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
|
+
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
12
|
+
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
11
13
|
/**
|
|
12
14
|
* Default currency configuration
|
|
13
15
|
* Uses USD as the base currency with standard formatting
|
|
@@ -32,6 +34,7 @@ export declare const DEFAULT_COMPOSITION: string[];
|
|
|
32
34
|
/**
|
|
33
35
|
* Default visibility settings for card elements
|
|
34
36
|
* Omnibus elements are hidden by default (not all regions require them)
|
|
37
|
+
* The block-level title is visible on a fresh drop.
|
|
35
38
|
*/
|
|
36
39
|
export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
|
|
37
40
|
/**
|
|
@@ -47,9 +50,3 @@ export declare const DEFAULT_NODE_CONFIG: RecommendationNodeConfig;
|
|
|
47
50
|
* View Together and Purchase Together algorithms are disabled because these require product id.
|
|
48
51
|
*/
|
|
49
52
|
export declare const EXCLUDED_ALGORITHM_IDS: number[];
|
|
50
|
-
/**
|
|
51
|
-
* Current configuration version
|
|
52
|
-
* Increment this when making breaking changes to the schema
|
|
53
|
-
* Used for migration detection
|
|
54
|
-
*/
|
|
55
|
-
export declare const CURRENT_CONFIG_VERSION = 1;
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { RecommendationBlockId } from './blockIds';
|
|
10
10
|
export { RecommendationControlId } from './controlIds';
|
|
11
|
-
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, 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, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
11
|
+
export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, 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, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, CSS_CLASS_ATTRIBUTE_ROW, CSS_CLASS_SPACER, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, ATTR_DATA_VISIBILITY, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
|
|
12
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, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
|
|
13
|
-
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
13
|
+
export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, PRE_RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
|
|
@@ -58,6 +58,10 @@ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
|
|
|
58
58
|
export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
|
|
59
59
|
export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
|
|
60
60
|
export declare const ATTR_PRODUCT_BUTTON = "productButton";
|
|
61
|
+
export declare const ATTR_RECOMMENDATION_TITLE = "recommendationTitle";
|
|
62
|
+
export declare const CSS_CLASS_TITLE_CELL = "ins-recommendation-title";
|
|
63
|
+
/** Title cell — the only `esd-block-text` living outside the product containers. */
|
|
64
|
+
export declare const SELECTOR_TITLE_CELL = ".ins-recommendation-title";
|
|
61
65
|
/**
|
|
62
66
|
* Custom attribute constants
|
|
63
67
|
* Used for dynamically added product attributes in Card Composition
|
|
@@ -68,12 +72,20 @@ export declare const ATTR_CUSTOM_PREFIX = "customAttr:";
|
|
|
68
72
|
export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
|
|
69
73
|
/** HTML data attribute on the block root holding the comma-joined composition order */
|
|
70
74
|
export declare const ATTR_DATA_CARD_COMPOSITION = "data-card-composition";
|
|
75
|
+
/** HTML attribute on the block root carrying its per-document unique id */
|
|
76
|
+
export declare const RECOMMENDATION_ID_ATTR = "recommendation-id";
|
|
71
77
|
/** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
|
|
72
78
|
export declare const ATTR_PRODUCT_ATTR = "product-attr";
|
|
79
|
+
/** Class every composition attribute row carries — the visibility toggle and the compiler both key on it */
|
|
80
|
+
export declare const CSS_CLASS_ATTRIBUTE_ROW = "recommendation-attribute-row";
|
|
73
81
|
/** Row wrapper of one composition entry inside a product card */
|
|
74
82
|
export declare const SELECTOR_ATTRIBUTE_ROW = ".recommendation-attribute-row";
|
|
75
83
|
/** HTML attribute on an attribute row holding its composition key */
|
|
76
84
|
export declare const ATTR_DATA_ATTRIBUTE_TYPE = "data-attribute-type";
|
|
85
|
+
/** HTML attribute on an attribute row holding its visibility (`1` / `0`) */
|
|
86
|
+
export declare const ATTR_DATA_VISIBILITY = "data-visibility";
|
|
87
|
+
/** Class on the spacer cell of the row that trails a title */
|
|
88
|
+
export declare const CSS_CLASS_SPACER = "spacer";
|
|
77
89
|
/** Prefix `resolveProductAttrValue` puts on custom (non-default) product attributes in `product-attr` values */
|
|
78
90
|
export declare const PRODUCT_ATTRIBUTE_PREFIX = "product_attribute.";
|
|
79
91
|
/**
|
|
@@ -33,6 +33,8 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
33
33
|
private _normalizeComposition;
|
|
34
34
|
private _readCustomAttributesFromNode;
|
|
35
35
|
private _readVisibilityFromRows;
|
|
36
|
+
private _withTitlePresence;
|
|
37
|
+
private _hasTitle;
|
|
36
38
|
private _getDefaultVisibilities;
|
|
37
39
|
private _extractVisibilityFromRows;
|
|
38
40
|
private _parseVisibilityValue;
|
|
@@ -187,6 +189,15 @@ export declare class RecommendationCardCompositionControl extends CommonControl
|
|
|
187
189
|
*/
|
|
188
190
|
private _buildCompositionHtml;
|
|
189
191
|
private _applyVisibilityToBlock;
|
|
192
|
+
private _applyTitleVisibilityToBlock;
|
|
193
|
+
private _resolveTitleInjection;
|
|
194
|
+
private _readTitleHtml;
|
|
195
|
+
private _findTitleRows;
|
|
196
|
+
private _findTitleRowsByClass;
|
|
197
|
+
private _isSpacerRow;
|
|
198
|
+
private _findTitleContainerBody;
|
|
199
|
+
private _readInnerHtml;
|
|
200
|
+
private _defaultTitleParagraph;
|
|
190
201
|
/**
|
|
191
202
|
* Finds the composition array index for the Nth custom attribute (0-based).
|
|
192
203
|
* Scans left-to-right, counting only entries with the custom prefix.
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
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, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, } from './main';
|
|
13
13
|
export * from './main/utils';
|
|
14
|
+
export { TitleControls } from './title';
|
|
14
15
|
export { NameControls } from './name';
|
|
15
16
|
export { PriceControls } from './price';
|
|
16
17
|
export { OldPriceControls } from './oldPrice';
|
|
@@ -9,8 +9,9 @@ import { PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID } from './pricePlacem
|
|
|
9
9
|
import { ProductCountControl, PRODUCT_COUNT_CONTROL_ID } from './productCount';
|
|
10
10
|
import { ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID } from './productLayout';
|
|
11
11
|
import { ShuffleControl, SHUFFLE_CONTROL_ID } from './shuffle';
|
|
12
|
+
import { StrategyControl, STRATEGY_CONTROL_ID } from './strategy';
|
|
12
13
|
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
13
|
-
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, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, };
|
|
14
|
+
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, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, StrategyControl, STRATEGY_CONTROL_ID, };
|
|
14
15
|
export * from './utils';
|
|
15
16
|
/**
|
|
16
17
|
* Main recommendation block control that composes all sub-controls
|
|
@@ -19,7 +20,9 @@ export * from './utils';
|
|
|
19
20
|
export declare class RecommendationBlockControl extends CommonControl {
|
|
20
21
|
private store;
|
|
21
22
|
private storeUnsubscription;
|
|
22
|
-
private
|
|
23
|
+
private syncedConfigs;
|
|
24
|
+
private pendingNodeConfigWrite;
|
|
25
|
+
private pendingConfigFlushTimer;
|
|
23
26
|
private algorithmControl;
|
|
24
27
|
private localeControl;
|
|
25
28
|
private currencyControl;
|
|
@@ -29,8 +32,12 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
29
32
|
private shuffleControl;
|
|
30
33
|
private pricePlacementControl;
|
|
31
34
|
private layoutOrientationControl;
|
|
35
|
+
private strategyControl;
|
|
36
|
+
private rrsEnabled;
|
|
32
37
|
getId(): string;
|
|
38
|
+
private get _subControls();
|
|
33
39
|
getTemplate(): string;
|
|
40
|
+
private _showControlsForBlock;
|
|
34
41
|
onRender(): Promise<void>;
|
|
35
42
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
36
43
|
onDestroy(): void;
|
|
@@ -42,7 +49,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
42
49
|
/**
|
|
43
50
|
* Syncs persisted node config into the Pinia store's block state.
|
|
44
51
|
*
|
|
45
|
-
* setCurrentBlock() creates a default entry (USD, en_US, mostPopular).
|
|
46
52
|
* For saved templates, the real config lives in the node (e.g., TRY, tr_TR).
|
|
47
53
|
* This method reads it and patches the store so fetchRecommendationProducts()
|
|
48
54
|
* uses the correct values.
|
|
@@ -50,6 +56,41 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
50
56
|
* Uses triggerRefetch: false because the fetch hasn't happened yet —
|
|
51
57
|
* values are being prepared for the upcoming initial fetch.
|
|
52
58
|
*/
|
|
59
|
+
/**
|
|
60
|
+
* Re-syncs the store when the node config moved since we last read it.
|
|
61
|
+
*
|
|
62
|
+
* Undo/redo, the code editor and version-history restore rewrite the node
|
|
63
|
+
* config behind the store's back — Stripo exposes no undo signal, so a
|
|
64
|
+
* fingerprint diff on this hook is the only way to notice (SD-149105).
|
|
65
|
+
* An unchanged fingerprint means the move came from us, so runtime store
|
|
66
|
+
* edits are never clobbered (SD-141049).
|
|
67
|
+
*/
|
|
68
|
+
private _syncNodeConfigIfChanged;
|
|
69
|
+
private _capturePendingNodeConfigWrite;
|
|
70
|
+
/**
|
|
71
|
+
* Accumulates the pending write into `documentModifier` without applying, so the
|
|
72
|
+
* caller's apply() commits config and re-render as ONE undo entry.
|
|
73
|
+
*
|
|
74
|
+
* Deliberately does not consume the pending record: the product helpers call
|
|
75
|
+
* apply() only when they actually changed something, so this batch may never be
|
|
76
|
+
* committed and the flush has to stay able to write it standalone.
|
|
77
|
+
* @param documentModifier - The batch to accumulate into
|
|
78
|
+
* @returns Whether anything was staged
|
|
79
|
+
*/
|
|
80
|
+
private _stagePendingNodeConfig;
|
|
81
|
+
/**
|
|
82
|
+
* Arms the guaranteed fallback write, once the product fetch has settled. The
|
|
83
|
+
* delay only has to outlast the re-render debounce that fetch triggers — firing
|
|
84
|
+
* earlier writes the config on its own and the undo entry splits in two again.
|
|
85
|
+
*/
|
|
86
|
+
private _scheduleConfigFlush;
|
|
87
|
+
private _clearConfigFlush;
|
|
88
|
+
/**
|
|
89
|
+
* Writes the deferred change standalone when the batch it was staged into never
|
|
90
|
+
* committed. Always targets the LIVE node — the captured one is an immutable
|
|
91
|
+
* snapshot the intervening re-render staled, and saveConfig swallows that failure.
|
|
92
|
+
*/
|
|
93
|
+
private _flushPendingNodeConfig;
|
|
53
94
|
private _syncNodeConfigToStore;
|
|
54
95
|
/**
|
|
55
96
|
* Fetches initial data for a block in three phases:
|
|
@@ -106,9 +147,4 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
106
147
|
* We skip that tick and update tracking references instead.
|
|
107
148
|
*/
|
|
108
149
|
private _listenStateUpdates;
|
|
109
|
-
/**
|
|
110
|
-
* Persists the current filter state from Pinia store to the Stripo node config.
|
|
111
|
-
* This ensures filters survive template save/reload cycles.
|
|
112
|
-
*/
|
|
113
|
-
private _persistFiltersToNodeConfig;
|
|
114
150
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonControl } from '../../../common-control';
|
|
2
|
+
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
|
+
export declare class StrategyControl extends CommonControl {
|
|
4
|
+
private store;
|
|
5
|
+
private storeUnsubscription;
|
|
6
|
+
private listeners;
|
|
7
|
+
private lastPaintedState;
|
|
8
|
+
getId(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
private _strategyAction;
|
|
11
|
+
onRender(): void;
|
|
12
|
+
onDestroy(): void;
|
|
13
|
+
private _teardown;
|
|
14
|
+
private _setupButtonListeners;
|
|
15
|
+
private _renderState;
|
|
16
|
+
}
|
|
@@ -70,6 +70,7 @@ export interface RegenerateProductRowsOptions {
|
|
|
70
70
|
/** Optional: pass composition directly to avoid stale DOM reads after setAttribute */
|
|
71
71
|
composition?: string[];
|
|
72
72
|
}
|
|
73
|
+
export declare function getMainContainerTbody(currentNode: ImmutableHtmlNode): ImmutableHtmlNode | null;
|
|
73
74
|
/**
|
|
74
75
|
* Regenerates only the mobile product container rows and commits in a single apply().
|
|
75
76
|
* Standalone entry point for callers that change mobile-only settings
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const TitleControls: {
|
|
2
|
+
readonly align: {
|
|
3
|
+
new (): {
|
|
4
|
+
getId(): string;
|
|
5
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
6
|
+
getParentControlId(): string;
|
|
7
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
8
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
9
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
10
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
11
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly color: {
|
|
15
|
+
new (): {
|
|
16
|
+
getId(): string;
|
|
17
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
18
|
+
getParentControlId(): string;
|
|
19
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
20
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
21
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
22
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
23
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly size: {
|
|
27
|
+
new (): {
|
|
28
|
+
getId(): string;
|
|
29
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
30
|
+
getParentControlId(): string;
|
|
31
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
32
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
33
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
34
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
35
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly style: {
|
|
39
|
+
new (): {
|
|
40
|
+
getId(): string;
|
|
41
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
42
|
+
getParentControlId(): string;
|
|
43
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
44
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
45
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
46
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
47
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly fontFamily: {
|
|
51
|
+
new (): {
|
|
52
|
+
getId(): string;
|
|
53
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
54
|
+
getParentControlId(): string;
|
|
55
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
56
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
57
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
58
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
59
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
readonly background: {
|
|
63
|
+
new (): {
|
|
64
|
+
getId(): string;
|
|
65
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
66
|
+
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
67
|
+
getParentControlId(): string;
|
|
68
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
69
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
70
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
71
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly paddings: {
|
|
75
|
+
new (): {
|
|
76
|
+
getId(): string;
|
|
77
|
+
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
78
|
+
getParentControlId(): string;
|
|
79
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
80
|
+
getLabels(): import("@stripoinc/ui-editor-extensions").ControlLabels | undefined;
|
|
81
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
82
|
+
getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
83
|
+
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
@@ -25,7 +25,7 @@ import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
|
25
25
|
* Stripo Extension API interface for document modifications
|
|
26
26
|
* Extracted to allow type-safe usage without importing full Stripo types
|
|
27
27
|
*/
|
|
28
|
-
interface DocumentModifier {
|
|
28
|
+
export interface DocumentModifier {
|
|
29
29
|
modifyHtml: (node: ImmutableHtmlNode) => {
|
|
30
30
|
setNodeConfig: (config: Record<string, unknown>) => DocumentModifier;
|
|
31
31
|
setAttribute: (name: string, value: string) => DocumentModifier;
|
|
@@ -90,6 +90,17 @@ export declare class RecommendationConfigService {
|
|
|
90
90
|
* @returns The new complete configuration
|
|
91
91
|
*/
|
|
92
92
|
static updateConfig(api: DocumentModifierApi, node: ImmutableHtmlNode, updates: PartialNodeConfig, description: string): RecommendationNodeConfig;
|
|
93
|
+
/**
|
|
94
|
+
* Accumulate a config update into an existing modifier batch, WITHOUT applying.
|
|
95
|
+
*
|
|
96
|
+
* The caller owns the apply(), so the write shares one undo entry with the rest
|
|
97
|
+
* of that batch — a change whose visible result only lands after an async product
|
|
98
|
+
* fetch would otherwise cost the user two undo presses (SD-149105).
|
|
99
|
+
* @param documentModifier - The batch to accumulate into (caller applies)
|
|
100
|
+
* @param node - The immutable HTML node to write to
|
|
101
|
+
* @param updates - Partial config with values to update
|
|
102
|
+
*/
|
|
103
|
+
static stageConfig(documentModifier: DocumentModifier, node: ImmutableHtmlNode, updates: PartialNodeConfig): void;
|
|
93
104
|
/**
|
|
94
105
|
* Initialize configuration for a new block
|
|
95
106
|
*
|