@useinsider/guido 3.12.0-beta.cfe6433 → 3.12.0-beta.d77b0d2
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 +9 -4
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
- package/dist/composables/useHtmlValidator.js +68 -60
- package/dist/composables/useHttp.js +61 -52
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +56 -40
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useSave.js +22 -22
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/config/migrator/recommendationMigrator.js +7 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/filteringV2.js +1024 -0
- package/dist/enums/extensions/recommendationBlock.js +45 -24
- package/dist/enums/extensions/strategyDetail.js +149 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +297 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +137 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +549 -165
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/common-control.js +37 -35
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +127 -33
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +2 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +2 -0
- package/dist/src/composables/useStrategyFilters.d.ts +24 -0
- package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +33 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +118 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +958 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -2
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +9 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/templatePreparation.js +70 -57
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { CommonControl } from '../../../common-control';
|
|
2
|
+
export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
3
|
+
/**
|
|
4
|
+
* Control for selecting a Reusable Recommendation Strategy
|
|
5
|
+
*/
|
|
6
|
+
export declare class StrategyControl extends CommonControl {
|
|
7
|
+
private store;
|
|
8
|
+
/**
|
|
9
|
+
* InOne's dictionary, not Stripo's. Every dotted key here
|
|
10
|
+
* (`discovery-strategy.*`, `gpt-app-builder.*`) lives in the host panel's
|
|
11
|
+
* translations, which `this.api.translate` does not read — that one is only
|
|
12
|
+
* for the plain-English control labels the rest of this panel uses.
|
|
13
|
+
*/
|
|
14
|
+
private trans;
|
|
15
|
+
private events;
|
|
16
|
+
private unsubscribeStore;
|
|
17
|
+
private cardHideTimer;
|
|
18
|
+
/**
|
|
19
|
+
* Resolved once per render.
|
|
20
|
+
*
|
|
21
|
+
* The card stays INSIDE the control's markup. Parking it at the top of the
|
|
22
|
+
* shadow root positions it identically but places it outside the settings
|
|
23
|
+
* panel, and Stripo reads a press there as a press on the canvas: the block
|
|
24
|
+
* is deselected, the panel closes, and View More never gets its click.
|
|
25
|
+
*/
|
|
26
|
+
private card;
|
|
27
|
+
getId(): string;
|
|
28
|
+
getTemplate(): string;
|
|
29
|
+
onRender(): void;
|
|
30
|
+
onDestroy(): void;
|
|
31
|
+
private _root;
|
|
32
|
+
private _setupEventListeners;
|
|
33
|
+
/**
|
|
34
|
+
* The card follows Stripo's own option rows.
|
|
35
|
+
*
|
|
36
|
+
* Stripo does not render the dropdown inside `ue-select`: it hands the list to
|
|
37
|
+
* `UE-FLOATING-COMPONENTS-CONTAINER`, a sibling of the whole settings panel.
|
|
38
|
+
* The shadow root is the only node that is an ancestor of both, so that is
|
|
39
|
+
* where the listener goes.
|
|
40
|
+
*
|
|
41
|
+
* `capture: true` is load-bearing, not caution. Stripo binds its own
|
|
42
|
+
* `mouseover` on the option row to drive `ue-select`'s `hoverItem` output and
|
|
43
|
+
* stops propagation there — measured: a bubble-phase listener on the shadow
|
|
44
|
+
* root sees nothing, the event dies one level above the row. Capture runs
|
|
45
|
+
* root-to-target, before that handler ever gets to speak.
|
|
46
|
+
*
|
|
47
|
+
* `mouseover`/`mouseout` rather than `mouseenter`/`mouseleave` because the
|
|
48
|
+
* latter do not participate in delegation at all, and the row is resolved
|
|
49
|
+
* through `composedPath()` rather than `event.target`.
|
|
50
|
+
*
|
|
51
|
+
* A row is matched to a strategy by its label, which doubles as the scope
|
|
52
|
+
* check — hovering the Locale or Currency dropdown finds no match and is
|
|
53
|
+
* ignored. Two strategies sharing a name would show the first one's card;
|
|
54
|
+
* Smart Recommender does not enforce unique names, and that is the cost.
|
|
55
|
+
*/
|
|
56
|
+
private _setupCardListeners;
|
|
57
|
+
/**
|
|
58
|
+
* Guarded the same way `AlgorithmControl` guards its own select: writing the
|
|
59
|
+
* value back in `_render()` re-fires `onValueChanged`, and without this the
|
|
60
|
+
* control would re-select on every store change.
|
|
61
|
+
*/
|
|
62
|
+
private _onStrategyChange;
|
|
63
|
+
/**
|
|
64
|
+
* Keeps the select's items, its value and the gear's enabled state in step
|
|
65
|
+
* with the store.
|
|
66
|
+
*
|
|
67
|
+
* All three depend on data that arrives after the first render: the strategy
|
|
68
|
+
* listing is fetched asynchronously, and `strategyId` changes when the user
|
|
69
|
+
* picks, duplicates, or switches blocks.
|
|
70
|
+
*/
|
|
71
|
+
private _subscribeToStoreChanges;
|
|
72
|
+
/**
|
|
73
|
+
* Fingerprint of everything the rendered control depends on.
|
|
74
|
+
*
|
|
75
|
+
* Ids rather than a count: a refetch that renames a strategy or swaps one for
|
|
76
|
+
* another of the same length would otherwise leave the select showing stale
|
|
77
|
+
* copy until some unrelated store change happened to repaint.
|
|
78
|
+
*/
|
|
79
|
+
private _stateKey;
|
|
80
|
+
private _render;
|
|
81
|
+
/**
|
|
82
|
+
* A strategy id the listing no longer knows was deleted in Smart Recommender.
|
|
83
|
+
* The id is deliberately kept (the save gate needs to see it) but the select
|
|
84
|
+
* falls back to its placeholder, so without this a broken block would look
|
|
85
|
+
* like one that was simply never configured.
|
|
86
|
+
*/
|
|
87
|
+
private _renderMissingMessage;
|
|
88
|
+
/**
|
|
89
|
+
* The hover card is `position: fixed`, so it can sit beside the narrow panel
|
|
90
|
+
* instead of being clipped by it. Placed once per hover — the list cannot
|
|
91
|
+
* scroll under the pointer without the pointer leaving, so there is nothing
|
|
92
|
+
* to keep in sync.
|
|
93
|
+
*/
|
|
94
|
+
private _showCard;
|
|
95
|
+
/**
|
|
96
|
+
* Resolves one of Stripo's option rows back to the strategy it was built from.
|
|
97
|
+
*
|
|
98
|
+
* Matched against the *rendered option labels*, not raw strategy names. Stripo's
|
|
99
|
+
* row carries no value of its own — its bindings are disabled/selected/tabindex —
|
|
100
|
+
* so the text is all there is, and `getStrategyOptions` disambiguates duplicate
|
|
101
|
+
* names by appending the id. Comparing to `strategy.name` would miss exactly those
|
|
102
|
+
* rows; going through the option list keeps the label the user sees and the label
|
|
103
|
+
* we match on in lockstep.
|
|
104
|
+
*/
|
|
105
|
+
private _strategyForItem;
|
|
106
|
+
/** Grace period for the pointer to cross the gap between the row and the card. */
|
|
107
|
+
private _scheduleHideCard;
|
|
108
|
+
private _cancelHideCard;
|
|
109
|
+
private _hideCard;
|
|
110
|
+
/**
|
|
111
|
+
* Mirrors the design system's `InInfoBox`: coloured top rule, heading +
|
|
112
|
+
* "last updated" details, content, then a divided footer holding the View
|
|
113
|
+
* More text button. The component itself cannot render here, so the markup
|
|
114
|
+
* and the CSS reproduce its structure and tokens rather than approximating
|
|
115
|
+
* them — the values in `recommendation.css` are read from its stylesheet.
|
|
116
|
+
*/
|
|
117
|
+
private _buildCardHtml;
|
|
118
|
+
}
|