@useinsider/guido 3.17.0-beta.6255bfc → 3.17.0-beta.668ca65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +0 -5
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +76 -73
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -10
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +75 -36
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +62 -0
- package/dist/composables/useRecommendation.js +29 -30
- package/dist/config/migrator/recommendation/settingsMapper.js +0 -2
- package/dist/config/migrator/recommendationMigrator.js +0 -1
- package/dist/enums/date.js +5 -4
- package/dist/enums/extensions/recommendationBlock.js +0 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +0 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +27 -45
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -18
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +111 -166
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +11 -17
- package/dist/src/@types/config/schemas.d.ts +0 -10
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -14
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -56
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -5
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -61
- package/dist/src/services/recommendationApi.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/static/assets/icons/line-delete.svg.js +2 -2
- package/dist/static/assets/icons/line-plus.svg.js +2 -2
- package/dist/static/styles/components/recommendation-strategy.css.js +2 -35
- package/dist/utils/dateUtil.js +18 -24
- package/dist/utils/templatePreparation.js +0 -2
- package/package.json +2 -2
- package/dist/src/utils/strategyInfoBox.d.ts +0 -22
- package/dist/utils/strategyInfoBox.js +0 -37
|
@@ -395,11 +395,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
395
395
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
396
396
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
397
397
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
398
|
-
/**
|
|
399
|
-
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
400
|
-
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
401
|
-
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
402
|
-
*/
|
|
403
398
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
404
399
|
}, undefined>;
|
|
405
400
|
/**
|
|
@@ -800,11 +795,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
800
795
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
801
796
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
802
797
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
803
|
-
/**
|
|
804
|
-
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
805
|
-
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
806
|
-
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
807
|
-
*/
|
|
808
798
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
809
799
|
}, undefined>, {}>;
|
|
810
800
|
/** Block configuration */
|
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
|
+
};
|
|
@@ -35,9 +35,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
35
35
|
size: "X-small" | "small" | "medium" | "large";
|
|
36
36
|
description: string;
|
|
37
37
|
closeOnOutsideClick: boolean;
|
|
38
|
-
footerStatus: boolean;
|
|
39
38
|
footerButtonOptions: FooterButtonGroup;
|
|
40
39
|
closeButtonStatus: boolean;
|
|
40
|
+
footerStatus: boolean;
|
|
41
41
|
}>;
|
|
42
42
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
43
43
|
export default _default;
|
package/dist/src/enums/date.d.ts
CHANGED
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
* - Merging partial updates with existing config
|
|
9
9
|
*/
|
|
10
10
|
import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
|
|
11
|
-
/**
|
|
12
|
-
* Config version, doubling as an era marker: v1 blocks predate the reusable
|
|
13
|
-
* recommendation strategy, v2 blocks can carry one. A v1 block is a valid
|
|
14
|
-
* terminal state — it is preserved, never migrated up (SD-149105).
|
|
15
|
-
*/
|
|
16
11
|
export declare const PRE_RRS_CONFIG_VERSION = 1;
|
|
17
12
|
export declare const CURRENT_CONFIG_VERSION = 2;
|
|
18
13
|
/**
|
|
@@ -31,15 +31,10 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
31
31
|
private pricePlacementControl;
|
|
32
32
|
private layoutOrientationControl;
|
|
33
33
|
private strategyControl;
|
|
34
|
+
private rrsEnabled;
|
|
34
35
|
getId(): string;
|
|
35
|
-
/** Every sub-control the coordinator owns, in panel order. */
|
|
36
36
|
private get _subControls();
|
|
37
37
|
getTemplate(): string;
|
|
38
|
-
/**
|
|
39
|
-
* Shows the selected block's own set of controls. A block is strategy-backed
|
|
40
|
-
* when a flag-on session stamped its config version, or when it already
|
|
41
|
-
* carries a strategy — an assignment must stay editable however it arrived.
|
|
42
|
-
*/
|
|
43
38
|
private _showControlsForBlock;
|
|
44
39
|
onRender(): Promise<void>;
|
|
45
40
|
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
@@ -52,7 +47,6 @@ export declare class RecommendationBlockControl extends CommonControl {
|
|
|
52
47
|
/**
|
|
53
48
|
* Syncs persisted node config into the Pinia store's block state.
|
|
54
49
|
*
|
|
55
|
-
* setCurrentBlock() creates a default entry (USD, en_US, mostPopular).
|
|
56
50
|
* For saved templates, the real config lives in the node (e.g., TRY, tr_TR).
|
|
57
51
|
* This method reads it and patches the store so fetchRecommendationProducts()
|
|
58
52
|
* uses the correct values.
|
|
@@ -7,24 +7,10 @@ export declare class StrategyControl extends CommonControl {
|
|
|
7
7
|
private lastPaintedState;
|
|
8
8
|
getId(): string;
|
|
9
9
|
getTemplate(): string;
|
|
10
|
-
/**
|
|
11
|
-
* Change / Remove are icon+text actions in the design, not buttons — and
|
|
12
|
-
* `ue-button` cannot pair a caption with an arbitrary icon, so these are
|
|
13
|
-
* plain elements. Click wiring is by id, which works on any element.
|
|
14
|
-
*
|
|
15
|
-
* The icon is a CSS mask, not inline SVG: Stripo re-creates the control's
|
|
16
|
-
* markup through Angular, which rebuilds `<svg>` outside the SVG namespace
|
|
17
|
-
* (the view-box attribute comes back lowercased) and it never paints.
|
|
18
|
-
*/
|
|
19
10
|
private _strategyAction;
|
|
20
11
|
onRender(): void;
|
|
21
12
|
onDestroy(): void;
|
|
22
13
|
private _teardown;
|
|
23
14
|
private _setupButtonListeners;
|
|
24
|
-
/**
|
|
25
|
-
* Toggles empty vs assigned state from the store's current block config.
|
|
26
|
-
* Display name comes from the listing; falls back to the raw id while the
|
|
27
|
-
* listing loads (or when the strategy is no longer listed).
|
|
28
|
-
*/
|
|
29
15
|
private _renderState;
|
|
30
16
|
}
|
|
@@ -21,7 +21,6 @@ export interface PerBlockConfigs {
|
|
|
21
21
|
sendProductRequestFlag: boolean;
|
|
22
22
|
shuffleProducts: boolean;
|
|
23
23
|
strategy: string;
|
|
24
|
-
/** Assigned RRS id ('' = none) — mirrors RecommendationNodeConfig.strategyId (SD-149105) */
|
|
25
24
|
strategyId: string;
|
|
26
25
|
textTrimming: boolean;
|
|
27
26
|
unresponsive: boolean;
|
|
@@ -35,7 +34,6 @@ interface PerBlockState {
|
|
|
35
34
|
recommendationProducts: RecommendationProduct[];
|
|
36
35
|
filterStatus: boolean;
|
|
37
36
|
filterSelectionDrawerStatus: boolean;
|
|
38
|
-
/** Assign Recommendation Strategy drawer visibility (SD-149105) */
|
|
39
37
|
assignStrategyDrawerStatus: boolean;
|
|
40
38
|
filterGroup: number;
|
|
41
39
|
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
@@ -156,9 +154,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
156
154
|
currentRecommendationId: number | null;
|
|
157
155
|
configVersion: number;
|
|
158
156
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Proxy getter: delegates to blockStates[currentRecommendationId].assignStrategyDrawerStatus
|
|
161
|
-
*/
|
|
162
157
|
assignStrategyDrawerStatus(state: {
|
|
163
158
|
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
164
159
|
activePredictiveAlgorithms: number[];
|
|
@@ -182,10 +177,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
182
177
|
currentRecommendationId: number | null;
|
|
183
178
|
configVersion: number;
|
|
184
179
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
185
|
-
/**
|
|
186
|
-
* The current block's assigned strategy record from the listing,
|
|
187
|
-
* or null when nothing is assigned / the strategy is no longer listed.
|
|
188
|
-
*/
|
|
189
180
|
assignedStrategy(state: {
|
|
190
181
|
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
191
182
|
activePredictiveAlgorithms: number[];
|
|
@@ -413,46 +404,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
413
404
|
* to the snapshot taken when the drawer was opened.
|
|
414
405
|
*/
|
|
415
406
|
cancelFilterDrawer(): void;
|
|
416
|
-
/**
|
|
417
|
-
* Opens the Assign Strategy drawer for the current block.
|
|
418
|
-
* Selection state lives in the drawer component until Assign is
|
|
419
|
-
* pressed, so closing without assigning needs no snapshot/revert.
|
|
420
|
-
*/
|
|
421
407
|
openAssignStrategyDrawer(): void;
|
|
422
408
|
closeAssignStrategyDrawer(): void;
|
|
423
|
-
/**
|
|
424
|
-
* Fetches the active + EMAIL strategy listing. Always fetches fresh
|
|
425
|
-
* (dead-strategy detection and post-create refresh need freshness);
|
|
426
|
-
* only concurrent in-flight calls share one request.
|
|
427
|
-
*/
|
|
428
409
|
fetchStrategies(): Promise<void>;
|
|
429
|
-
/**
|
|
430
|
-
* Resolves a strategy's recommendation endpoint template via
|
|
431
|
-
* endpoint-generate, cached per strategy id + revision + currency.
|
|
432
|
-
* Failures throw and are NOT cached, so the next attempt retries.
|
|
433
|
-
*
|
|
434
|
-
* `full_path` bakes in the algorithm path and `size=` as they were when
|
|
435
|
-
* generated, so the revision keys the cache — and a record with no
|
|
436
|
-
* revision is not cached at all, since its key could never change.
|
|
437
|
-
* Currency joins the key because it is sent in the request body, so two
|
|
438
|
-
* currencies can resolve to different paths for the same revision.
|
|
439
|
-
*/
|
|
440
410
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
441
|
-
/**
|
|
442
|
-
* Assigns a strategy to the current block. The config write is
|
|
443
|
-
* synchronous (before any await) so a block switch cannot misdirect
|
|
444
|
-
* it; the configVersion bump persists it to node config and triggers
|
|
445
|
-
* the product refetch via the coordinator control's subscription.
|
|
446
|
-
*/
|
|
447
411
|
assignStrategy(strategy: RrsStrategy): void;
|
|
448
|
-
/**
|
|
449
|
-
* Clears the current block's strategy; it falls back to the per-block
|
|
450
|
-
* algorithm settings.
|
|
451
|
-
*
|
|
452
|
-
* `size` goes back to the default rather than staying on the removed
|
|
453
|
-
* strategy's count: with Number of Products hidden in RRS mode, a block
|
|
454
|
-
* left on that count would have no UI to correct it.
|
|
455
|
-
*/
|
|
456
412
|
removeStrategy(): void;
|
|
457
413
|
fetchRecommendationCreateData(): Promise<void>;
|
|
458
414
|
fetchRecommendationFilters(): Promise<void>;
|
|
@@ -470,19 +426,7 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
470
426
|
hasInvalidBlock(): boolean;
|
|
471
427
|
fetchRecommendationProducts(): Promise<void>;
|
|
472
428
|
_doFetchProducts(): Promise<void>;
|
|
473
|
-
/**
|
|
474
|
-
* Fetches products for a strategy-backed block: listing lookup →
|
|
475
|
-
* endpoint-generate template → fill {locale}/{currency}, drop
|
|
476
|
-
* {user_id} (resolved at send time) → fetch. Any failure (dead
|
|
477
|
-
* strategy, resolution error) falls back to placeholder products.
|
|
478
|
-
*/
|
|
479
429
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
480
|
-
/**
|
|
481
|
-
* Writes products to a block's state, padded/clipped to exactly `size`:
|
|
482
|
-
* in-place content updates compare the DOM element count against
|
|
483
|
-
* products.length, and a longer list makes the renderer extend its slot
|
|
484
|
-
* grid, which resets migrator-applied styles.
|
|
485
|
-
*/
|
|
486
430
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
487
431
|
}>;
|
|
488
432
|
export {};
|
|
@@ -82,11 +82,6 @@ export interface RecommendationNodeConfig {
|
|
|
82
82
|
* Uses existing Filter interface from recommendation types
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
|
-
/**
|
|
86
|
-
* Assigned Reusable Recommendation Strategy id (SD-149105).
|
|
87
|
-
* '' = no strategy assigned; block uses the per-block settings above.
|
|
88
|
-
* When set, algorithm/size/filters/shuffle come from the strategy record.
|
|
89
|
-
*/
|
|
90
85
|
strategyId: string;
|
|
91
86
|
/**
|
|
92
87
|
* Layout orientation
|
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
export declare const MOCK_RRS_STRATEGIES: ({
|
|
2
|
-
strategy_id: number;
|
|
3
|
-
name: string;
|
|
4
|
-
status: string;
|
|
5
|
-
suitable_channels: string;
|
|
6
|
-
suitable_page_types: string;
|
|
7
|
-
algorithm: string;
|
|
8
|
-
algorithm_used: string;
|
|
9
|
-
method: string;
|
|
10
|
-
size: number;
|
|
11
|
-
filters: string;
|
|
12
|
-
shuffle: number;
|
|
13
|
-
attribute_affinity: number;
|
|
14
|
-
exclude_view: number;
|
|
15
|
-
exclude_purchase: number;
|
|
16
|
-
exclude_cart: number;
|
|
17
|
-
manual_merchandising_products: string;
|
|
18
|
-
fallback_config: null;
|
|
19
|
-
channelNames: string;
|
|
20
|
-
campaignCount: {
|
|
21
|
-
active: number;
|
|
22
|
-
passive: number;
|
|
23
|
-
test: number;
|
|
24
|
-
};
|
|
25
|
-
created_at: string;
|
|
26
|
-
updated_at: string;
|
|
27
|
-
last_updated_by: string;
|
|
28
|
-
mixed_strategies?: undefined;
|
|
29
|
-
exclude_view_duration?: undefined;
|
|
30
|
-
exclude_view_duration_type?: undefined;
|
|
31
|
-
} | {
|
|
32
|
-
strategy_id: number;
|
|
33
|
-
name: string;
|
|
34
|
-
status: string;
|
|
35
|
-
suitable_channels: string;
|
|
36
|
-
suitable_page_types: string;
|
|
37
|
-
algorithm: string;
|
|
38
|
-
algorithm_used: string;
|
|
39
|
-
mixed_strategies: string;
|
|
40
|
-
method: string;
|
|
41
|
-
size: number;
|
|
42
|
-
filters: string;
|
|
43
|
-
shuffle: number;
|
|
44
|
-
attribute_affinity: number;
|
|
45
|
-
exclude_view: number;
|
|
46
|
-
exclude_view_duration: number;
|
|
47
|
-
exclude_view_duration_type: string;
|
|
48
|
-
exclude_purchase: number;
|
|
49
|
-
exclude_cart: number;
|
|
50
|
-
manual_merchandising_products: string;
|
|
51
|
-
fallback_config: null;
|
|
52
|
-
channelNames: string;
|
|
53
|
-
campaignCount: {
|
|
54
|
-
active: number;
|
|
55
|
-
passive: number;
|
|
56
|
-
test: number;
|
|
57
|
-
};
|
|
58
|
-
created_at: string;
|
|
59
|
-
updated_at: string;
|
|
60
|
-
last_updated_by: string;
|
|
61
|
-
})[];
|
|
62
1
|
declare const _default: import("msw").HttpHandler[];
|
|
63
2
|
export default _default;
|
|
@@ -5,5 +5,5 @@ export declare const useRecommendationApi: () => {
|
|
|
5
5
|
fetchRecommendationProducts: (strategy: string, params: RecommendationProductsParams) => Promise<RecommendationProduct[]>;
|
|
6
6
|
fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
|
|
7
7
|
fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
|
|
8
|
-
generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse>;
|
|
8
|
+
generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse | null>;
|
|
9
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecommendationCampaignUrlValue } from '@@/Types/recommendation';
|
|
1
2
|
import type { MappedCategory } from '@@/Types/save-as-template';
|
|
2
3
|
interface StoreState {
|
|
3
4
|
templateName: string;
|
|
@@ -5,7 +6,7 @@ interface StoreState {
|
|
|
5
6
|
selectedCategories: MappedCategory[];
|
|
6
7
|
skeletonStatus: boolean;
|
|
7
8
|
recommendation: {
|
|
8
|
-
campaignUrls: Record<string,
|
|
9
|
+
campaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
9
10
|
configs: Record<string, string>;
|
|
10
11
|
};
|
|
11
12
|
unsubscribe: {
|
|
@@ -30,7 +31,7 @@ export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"gu
|
|
|
30
31
|
}[];
|
|
31
32
|
skeletonStatus: boolean;
|
|
32
33
|
recommendation: {
|
|
33
|
-
campaignUrls: Record<string,
|
|
34
|
+
campaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
34
35
|
configs: Record<string, string>;
|
|
35
36
|
};
|
|
36
37
|
unsubscribe: {
|
|
@@ -54,7 +55,7 @@ export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"gu
|
|
|
54
55
|
}[];
|
|
55
56
|
skeletonStatus: boolean;
|
|
56
57
|
recommendation: {
|
|
57
|
-
campaignUrls: Record<string,
|
|
58
|
+
campaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
58
59
|
configs: Record<string, string>;
|
|
59
60
|
};
|
|
60
61
|
unsubscribe: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 3a2 2 0 0 0-2 2v2H5a1 1 0 0 0 0 2h1v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V9h1a1 1 0 1 0 0-2h-3V5a2 2 0 0 0-2-2h-4zm4 4h-4V5h4v2zm-4 2h6v10H8V9h2zm2 2a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0v-4a1 1 0 0 0-1-1z"></path></svg>
|
|
2
2
|
`;
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
a as default
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 5a1 1 0 0 0-1 1v5H6a1 1 0 1 0 0 2h5v5a1 1 0 1 0 2 0v-5h5a1 1 0 1 0 0-2h-5V6a1 1 0 0 0-1-1z"></path></svg>
|
|
2
2
|
`;
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
a as default
|
|
5
5
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
const n =
|
|
2
|
-
(SD-149105). Scoped to the section's own classes/ids so nothing leaks into
|
|
3
|
-
other blocks' controls. Measurements come from the Figma frames
|
|
4
|
-
4880:44449 (empty) and 4826:7513 (assigned). */
|
|
5
|
-
|
|
6
|
-
.strategy-control-header {
|
|
1
|
+
const n = `.strategy-control-header {
|
|
7
2
|
padding: 16px 16px 0;
|
|
8
3
|
}
|
|
9
4
|
|
|
@@ -31,9 +26,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
31
26
|
text-decoration: underline;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
/* Assign + Create are two fixed 180px columns, left-aligned — not a stretched
|
|
35
|
-
half-and-half. The ancestor is load-bearing: it out-specifies the editor's own
|
|
36
|
-
\`.container.two-columns\` grid, which otherwise wins and leaves the CTAs uneven. */
|
|
37
29
|
.recommendation-controls-container .container.strategy-control-cta-row {
|
|
38
30
|
grid-template-columns: repeat(2, minmax(0, 180px));
|
|
39
31
|
justify-content: start;
|
|
@@ -41,9 +33,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
41
33
|
padding: 0 16px 16px;
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
/* The editor's grid does not stretch its items and the visible pill is the inner
|
|
45
|
-
\`.button\`, not the \`ue-button\` host — so both need the width or the two CTAs
|
|
46
|
-
come out sized to their own captions. */
|
|
47
36
|
.strategy-control-cta {
|
|
48
37
|
width: 100%;
|
|
49
38
|
}
|
|
@@ -60,8 +49,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
60
49
|
white-space: nowrap;
|
|
61
50
|
}
|
|
62
51
|
|
|
63
|
-
/* Secondary action keeps full contrast while disabled — the round trip ships
|
|
64
|
-
in a later phase, but the design shows it as a normal grey button. */
|
|
65
52
|
.strategy-control-cta.primary > .button:disabled,
|
|
66
53
|
.strategy-control-cta.primary > .button.disabled {
|
|
67
54
|
opacity: 1;
|
|
@@ -69,8 +56,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
69
56
|
cursor: default;
|
|
70
57
|
}
|
|
71
58
|
|
|
72
|
-
/* The assigned strategy's name sits in a band that spans the whole panel, so it
|
|
73
|
-
carries its own 16px inset instead of inheriting the section's. */
|
|
74
59
|
.strategy-control-name-band {
|
|
75
60
|
display: flex;
|
|
76
61
|
align-items: center;
|
|
@@ -104,16 +89,10 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
104
89
|
cursor: pointer;
|
|
105
90
|
}
|
|
106
91
|
|
|
107
|
-
/* The label carries the gap on both sides, which is also what separates Change
|
|
108
|
-
from Remove — matching the design's button wrappers. */
|
|
109
92
|
.strategy-control-action > span {
|
|
110
93
|
padding: 0 8px;
|
|
111
94
|
}
|
|
112
95
|
|
|
113
|
-
/* Icons are masks rather than inline SVG — Stripo rebuilds the control markup
|
|
114
|
-
through Angular, which recreates <svg> outside the SVG namespace so it never
|
|
115
|
-
paints. A mask is a background, so it survives that round trip. The glyphs
|
|
116
|
-
live in static/assets/icons and reach these vars via useCustomInterfaceAppearance. */
|
|
117
96
|
.strategy-control-action::before,
|
|
118
97
|
.strategy-control-cta.on > .button::before {
|
|
119
98
|
content: '';
|
|
@@ -123,22 +102,18 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
123
102
|
background-color: currentcolor;
|
|
124
103
|
mask-repeat: no-repeat;
|
|
125
104
|
mask-position: center;
|
|
105
|
+
mask-size: 24px 24px;
|
|
126
106
|
}
|
|
127
107
|
|
|
128
|
-
/* The design system's \`line-change\` glyph fills its 24px box; the 20px glyphs
|
|
129
|
-
are centred inside the same box, as the design draws them. */
|
|
130
108
|
.strategy-control-action--change::before {
|
|
131
|
-
mask-size: 24px 24px;
|
|
132
109
|
mask-image: var(--guido-icon-line-change);
|
|
133
110
|
}
|
|
134
111
|
|
|
135
112
|
.strategy-control-action--remove::before {
|
|
136
|
-
mask-size: 20px 20px;
|
|
137
113
|
mask-image: var(--guido-icon-line-delete);
|
|
138
114
|
}
|
|
139
115
|
|
|
140
116
|
.strategy-control-cta.on > .button::before {
|
|
141
|
-
mask-size: 20px 20px;
|
|
142
117
|
mask-image: var(--guido-icon-line-plus);
|
|
143
118
|
}
|
|
144
119
|
|
|
@@ -154,10 +129,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
154
129
|
text-decoration: underline;
|
|
155
130
|
}
|
|
156
131
|
|
|
157
|
-
/* Per-block controls (SD-149105). With the flag on the panel carries BOTH the
|
|
158
|
-
legacy and the strategy controls — Stripo reuses one panel across blocks of
|
|
159
|
-
the same type and never re-runs getTemplate() on a switch — and
|
|
160
|
-
\`.strategy-block\` picks which set the selected block shows. */
|
|
161
132
|
.recommendation-controls-container:not(.strategy-block) .strategy-control-container,
|
|
162
133
|
.recommendation-controls-container.strategy-block .product-count-control-container,
|
|
163
134
|
.recommendation-controls-container.strategy-block .algorithm-control-container,
|
|
@@ -166,10 +137,6 @@ const n = `/* Recommendation Strategy section of the recommendation block's sett
|
|
|
166
137
|
display: none;
|
|
167
138
|
}
|
|
168
139
|
|
|
169
|
-
/* The RRS panel's order (Figma 4826:7513) is the legacy DOM order with these
|
|
170
|
-
two sent to the end; everything else already lands where the design wants it.
|
|
171
|
-
Only \`.strategy-block\` becomes a flex container, so a legacy block keeps plain
|
|
172
|
-
block flow and stays exactly what it is with the flag off. */
|
|
173
140
|
.recommendation-controls-container.strategy-block {
|
|
174
141
|
display: flex;
|
|
175
142
|
flex-direction: column;
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { DEFAULT_LOCALE as
|
|
2
|
-
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(),
|
|
1
|
+
import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
|
|
2
|
+
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return (t == null ? void 0 : t.locale) ===
|
|
5
|
-
},
|
|
4
|
+
return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
|
|
5
|
+
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
|
|
6
6
|
const t = window.l10n;
|
|
7
|
-
return (t == null ? void 0 : t.timezone) ||
|
|
8
|
-
},
|
|
9
|
-
const
|
|
10
|
-
if (n)
|
|
11
|
-
return n;
|
|
12
|
-
const o = new Intl.DateTimeFormat(t, {
|
|
7
|
+
return (t == null ? void 0 : t.timezone) || u || c;
|
|
8
|
+
}, D = (t, e = s(), r = f()) => {
|
|
9
|
+
const o = {
|
|
13
10
|
year: "numeric",
|
|
14
11
|
month: "2-digit",
|
|
15
12
|
day: "2-digit",
|
|
16
|
-
timeZone:
|
|
17
|
-
});
|
|
18
|
-
return
|
|
19
|
-
}, T = (t
|
|
20
|
-
const n = m(t);
|
|
21
|
-
return l(e, r).format(n);
|
|
22
|
-
}, g = (t) => {
|
|
13
|
+
timeZone: r
|
|
14
|
+
}, i = m(t);
|
|
15
|
+
return new Intl.DateTimeFormat(e, o).format(i);
|
|
16
|
+
}, T = (t) => {
|
|
23
17
|
if (!t)
|
|
24
18
|
return "";
|
|
25
19
|
const e = new Date(t);
|
|
@@ -31,13 +25,13 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
|
|
|
31
25
|
second: "2-digit",
|
|
32
26
|
hour12: !1
|
|
33
27
|
}).format(e);
|
|
34
|
-
},
|
|
28
|
+
}, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
35
29
|
export {
|
|
36
30
|
m as convertToDateObject,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
T as formatPatchDate,
|
|
32
|
+
D as formatShortDate,
|
|
33
|
+
h as isAfterDate,
|
|
34
|
+
u as localTz,
|
|
35
|
+
s as locale,
|
|
36
|
+
f as timezone
|
|
43
37
|
};
|
|
@@ -43,8 +43,6 @@ async function M(m) {
|
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
45
|
strategy: L(e.strategy) || a.strategy,
|
|
46
|
-
// esd-ext-config is the source of truth for the assigned RRS —
|
|
47
|
-
// a strategy-backed block must survive save/reopen from it alone.
|
|
48
46
|
strategyId: e.strategyId ?? a.strategyId,
|
|
49
47
|
language: e.language ?? a.language,
|
|
50
48
|
size: e.size ?? a.size,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.17.0-beta.
|
|
3
|
+
"version": "3.17.0-beta.668ca65",
|
|
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",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
-
"@useinsider/design-system-organisms": "0.0.3-beta.
|
|
51
|
+
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
52
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
53
|
"@vueuse/core": "11.3.0",
|
|
54
54
|
"lodash-es": "4.17.21",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { RrsStrategy } from '@@/Types/recommendation';
|
|
2
|
-
import { useTranslations } from '@@/Composables/useTranslations';
|
|
3
|
-
export declare const STRATEGY_INFO_BOX_CLASS = "assign-strategy-info-box";
|
|
4
|
-
/**
|
|
5
|
-
* Props for the design system info box that previews a strategy on hover.
|
|
6
|
-
*
|
|
7
|
-
* The box is InSelect's own per-option feature: the dropdown v-binds this whole
|
|
8
|
-
* object onto `<in-info-box>`, so `titleText`/`descriptionText` are all it takes
|
|
9
|
-
* — no slot component. Both go through the design system's sanitizer, and every
|
|
10
|
-
* partner-supplied value is escaped here before it reaches that markup.
|
|
11
|
-
*
|
|
12
|
-
* `trans` is injectable because callers map this over a whole listing, and
|
|
13
|
-
* `useTranslations()` rebuilds its dictionary and memo cache on every call.
|
|
14
|
-
*/
|
|
15
|
-
export declare const buildStrategyInfoBoxProps: (strategy: RrsStrategy, trans?: ReturnType<typeof useTranslations>) => {
|
|
16
|
-
id: string;
|
|
17
|
-
theme: string;
|
|
18
|
-
variant: string;
|
|
19
|
-
className: string;
|
|
20
|
-
titleText: string;
|
|
21
|
-
descriptionText: string;
|
|
22
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useTranslations as m } from "../composables/useTranslations.js";
|
|
2
|
-
import { formatShortDate as u } from "./dateUtil.js";
|
|
3
|
-
import { escapeHtml as c } from "./htmlEscape.js";
|
|
4
|
-
const n = "assign-strategy-info-box", a = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : "", p = (e, t) => {
|
|
5
|
-
const r = a(e.algorithm) === "MIXED" ? t("discovery-strategy.mixed-algorithm") : t("discovery-strategy.single-algorithm"), i = a(e.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => t(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
|
|
6
|
-
return i.length ? `${r} · ${i.join(", ")}` : r;
|
|
7
|
-
}, g = (e, t) => [
|
|
8
|
-
[e.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
9
|
-
[e.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
10
|
-
[e.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
11
|
-
].filter(([r]) => Number(r) === 1).map(([, r]) => t(r)).join(", "), h = (e) => a(
|
|
12
|
-
e.manual_merchandising || e.manual_merchandising_products
|
|
13
|
-
).trim(), _ = (e) => {
|
|
14
|
-
const t = e.filters;
|
|
15
|
-
if (!t)
|
|
16
|
-
return 0;
|
|
17
|
-
try {
|
|
18
|
-
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
19
|
-
return Array.isArray(r) ? r.reduce((i, o) => i + (Array.isArray(o) ? o.length : 1), 0) : 0;
|
|
20
|
-
} catch {
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
}, s = (e, t) => `<div class="${n}__row"><span class="${n}__label">${c(e)}</span><span class="${n}__value">${c(t)}</span></div>`, v = (e, t = m()) => {
|
|
24
|
-
const r = t("recommendation-strategy.none"), i = a(e.updated_at || e.created_at), o = _(e), d = i ? c(t("recommendation-strategy.last-updated-on", { value: u(i) })) : "", l = d ? `<div class="${n}__updated">${d}</div>` : "";
|
|
25
|
-
return {
|
|
26
|
-
id: `strategy-info-${e.strategy_id}`,
|
|
27
|
-
theme: "light",
|
|
28
|
-
variant: "information",
|
|
29
|
-
className: n,
|
|
30
|
-
titleText: c(a(e.name)),
|
|
31
|
-
descriptionText: l + s(t("gpt-app-builder.algorithms-and-method"), p(e, t)) + s(t("gpt-app-builder.exclusions"), g(e, t) || r) + s(t("discovery-strategy.filters"), o ? String(o) : r) + s(t("action-builder.manual-merchandising"), h(e) || r)
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
n as STRATEGY_INFO_BOX_CLASS,
|
|
36
|
-
v as buildStrategyInfoBoxProps
|
|
37
|
-
};
|