@useinsider/guido 3.18.1-beta.23c7bd6 → 3.18.1-beta.280b4e1

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.
Files changed (52) hide show
  1. package/README.md +3 -21
  2. package/dist/@types/config/schemas.js +51 -59
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +53 -55
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +57 -82
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +24 -28
  9. package/dist/composables/useCustomInterfaceAppearance.js +42 -46
  10. package/dist/enums/extensions/recommendationBlock.js +31 -40
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +69 -70
  12. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +28 -72
  13. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
  14. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +57 -121
  15. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
  16. package/dist/guido.css +1 -1
  17. package/dist/library.js +15 -13
  18. package/dist/public/editorState.js +4 -0
  19. package/dist/services/recommendationApi.js +37 -46
  20. package/dist/src/@types/config/schemas.d.ts +0 -16
  21. package/dist/src/composables/useConfig.d.ts +0 -4
  22. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
  23. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
  24. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
  25. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -70
  26. package/dist/src/library.d.ts +2 -0
  27. package/dist/src/public/editorState.d.ts +14 -0
  28. package/dist/src/public/trackingIds.d.ts +6 -2
  29. package/dist/src/services/recommendationApi.d.ts +1 -2
  30. package/dist/src/stores/config.d.ts +0 -322
  31. package/dist/src/stores/guido-email-editor.d.ts +27 -27
  32. package/dist/src/stores/onboarding.d.ts +10 -808
  33. package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
  34. package/dist/stores/config.js +60 -74
  35. package/dist/stores/guido-email-editor.js +0 -4
  36. package/dist/stores/onboarding.js +36 -46
  37. package/package.json +5 -1
  38. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
  39. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
  40. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
  41. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
  42. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  43. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -46
  44. package/dist/composables/useLegacyStrategyConversion.js +0 -61
  45. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -42
  46. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
  47. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
  48. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
  49. package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
  50. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -32
  51. package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
  52. package/dist/static/assets/icons/line-info.svg.js +0 -5
@@ -50,14 +50,6 @@ export declare const IdentitySchema: v.ObjectSchema<{
50
50
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
51
51
  /** Optional variation ID for A/B testing */
52
52
  readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
- /** Optional numeric campaign ID of the host campaign; absent for templates and modules */
54
- readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
55
- /**
56
- * Optional numeric template-library id of the host template; absent for campaigns and
57
- * modules. Distinct from `templateId`, which is the editor's document identity (a uuid /
58
- * Stripo doc id) and is never an endpoint id.
59
- */
60
- readonly templateLibraryId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
61
53
  }, undefined>;
62
54
  /**
63
55
  * Partner configuration - organization and product context
@@ -633,14 +625,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
633
625
  readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
634
626
  /** Optional variation ID for A/B testing */
635
627
  readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
636
- /** Optional numeric campaign ID of the host campaign; absent for templates and modules */
637
- readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
638
- /**
639
- * Optional numeric template-library id of the host template; absent for campaigns and
640
- * modules. Distinct from `templateId`, which is the editor's document identity (a uuid /
641
- * Stripo doc id) and is never an endpoint id.
642
- */
643
- readonly templateLibraryId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
644
628
  }, undefined>;
645
629
  /** Partner configuration (required) */
646
630
  readonly partner: v.ObjectSchema<{
@@ -11,8 +11,6 @@ export declare const useConfig: () => {
11
11
  templateId: string;
12
12
  userId: string;
13
13
  variationId?: string | undefined;
14
- campaignId?: string | undefined;
15
- templateLibraryId?: string | undefined;
16
14
  };
17
15
  partner: {
18
16
  name: string;
@@ -148,8 +146,6 @@ export declare const useConfig: () => {
148
146
  templateId: string;
149
147
  userId: string;
150
148
  variationId?: string | undefined;
151
- campaignId?: string | undefined;
152
- templateLibraryId?: string | undefined;
153
149
  } | null>;
154
150
  partner: import("vue").ComputedRef<{
155
151
  name: string;
@@ -1,15 +1,11 @@
1
1
  import type { TextValueObject } from '@@/Types/generic';
2
- import type { RecommendationFeedItem, RrsMigrationTarget } from '@@/Types/recommendation';
2
+ 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
6
  RECOMMENDATION_STRATEGIES_PATH: string;
7
7
  RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
8
- NEWSLETTER_RECOMMENDATIONS_PATH: string;
9
- MIGRATE_STRATEGIES_PATH: string;
10
- TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
11
8
  };
12
- export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
13
9
  export declare const QUERY_PARAMS: {
14
10
  CLIENT_ID: string;
15
11
  };
@@ -2,8 +2,6 @@ import { CommonControl } from '../../../common-control';
2
2
  export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
3
3
  export declare class StrategyControl extends CommonControl {
4
4
  private store;
5
- private onboardingStore;
6
- private legacyConversion;
7
5
  private storeUnsubscription;
8
6
  private listeners;
9
7
  private lastPaintedState;
@@ -88,8 +88,6 @@ export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsO
88
88
  products?: RecommendationProduct[];
89
89
  /** Optional: pass layout directly to avoid stale DOM reads after setAttribute */
90
90
  layout?: Orientation;
91
- /** Applies the batch even when the rows are unchanged, for callers that staged their own edits. */
92
- forceApply?: boolean;
93
91
  }
94
92
  /**
95
93
  * Regenerates product rows while preserving user-applied styles, in a SINGLE commit.
@@ -153,8 +151,6 @@ export interface UpdateProductContentInPlaceOptions {
153
151
  currentNode: ImmutableHtmlNode | null | undefined;
154
152
  documentModifier: DocumentModifier;
155
153
  products: RecommendationProduct[];
156
- /** Applies the batch even when the cards are unchanged, for callers that staged their own edits. */
157
- forceApply?: boolean;
158
154
  }
159
155
  /**
160
156
  * Updates product content in-place without regenerating HTML structure.
@@ -1,4 +1,4 @@
1
- import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsMigrationPayload, RrsMigrationTarget, RrsStrategy } from '@@/Types/recommendation';
1
+ import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsStrategy } from '@@/Types/recommendation';
2
2
  export interface PerBlockConfigs {
3
3
  cardsInRow: number;
4
4
  currencySettings: {
@@ -22,7 +22,6 @@ export interface PerBlockConfigs {
22
22
  shuffleProducts: boolean;
23
23
  strategy: string;
24
24
  strategyId: string;
25
- nodeConfigVersion: number;
26
25
  textTrimming: boolean;
27
26
  unresponsive: boolean;
28
27
  size: string;
@@ -37,13 +36,11 @@ interface PerBlockState {
37
36
  filterSelectionDrawerStatus: boolean;
38
37
  assignStrategyDrawerStatus: boolean;
39
38
  removeStrategyModalStatus: boolean;
40
- legacyStrategyUpdatedModalStatus: boolean;
41
39
  filterGroup: number;
42
40
  /** Whether initial API data (filters, algorithms, products) has been fetched for this block */
43
41
  isInitialized: boolean;
44
42
  /** Snapshot of filters taken when the drawer opens, used to revert on cancel */
45
43
  filterSnapshot: Filter[] | null;
46
- legacyConversionLoading: boolean;
47
44
  }
48
45
  /**
49
46
  * Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
@@ -204,53 +201,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
204
201
  currentRecommendationId: number | null;
205
202
  configVersion: number;
206
203
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
207
- isLegacyStrategyBlock(): boolean;
208
- legacyConversionLoading(state: {
209
- recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
210
- activePredictiveAlgorithms: number[];
211
- languages: Languages;
212
- currencyList: {
213
- text: string;
214
- value: string;
215
- }[];
216
- filterList: FiltersResponse;
217
- strategies: {
218
- [x: string]: unknown;
219
- strategy_id: number;
220
- name: string;
221
- status: string;
222
- suitable_channels: string;
223
- size?: (number | string) | undefined;
224
- }[];
225
- strategiesLoading: boolean;
226
- strategyUrlTemplates: Record<string, string>;
227
- blockStates: Record<number, PerBlockState>;
228
- currentRecommendationId: number | null;
229
- configVersion: number;
230
- } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
231
- legacyStrategyUpdatedModalStatus(state: {
232
- recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
233
- activePredictiveAlgorithms: number[];
234
- languages: Languages;
235
- currencyList: {
236
- text: string;
237
- value: string;
238
- }[];
239
- filterList: FiltersResponse;
240
- strategies: {
241
- [x: string]: unknown;
242
- strategy_id: number;
243
- name: string;
244
- status: string;
245
- suitable_channels: string;
246
- size?: (number | string) | undefined;
247
- }[];
248
- strategiesLoading: boolean;
249
- strategyUrlTemplates: Record<string, string>;
250
- blockStates: Record<number, PerBlockState>;
251
- currentRecommendationId: number | null;
252
- configVersion: number;
253
- } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
254
204
  assignedStrategy(state: {
255
205
  recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
256
206
  activePredictiveAlgorithms: number[];
@@ -480,24 +430,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
480
430
  cancelFilterDrawer(): void;
481
431
  openAssignStrategyDrawer(): void;
482
432
  closeAssignStrategyDrawer(): void;
483
- openLegacyStrategyUpdatedModal(): void;
484
- closeLegacyStrategyUpdatedModal(): void;
485
433
  openRemoveStrategyModal(): void;
486
434
  closeRemoveStrategyModal(): void;
487
435
  fetchStrategies(): Promise<void>;
488
436
  resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
489
437
  assignStrategy(strategy: RrsStrategy): void;
490
- convertLegacyStrategy(payload: RrsMigrationPayload, target?: RrsMigrationTarget): Promise<string>;
491
- /**
492
- * Undoes the config half of a conversion whose document write never landed, so the
493
- * panel and the drawer fall back to "Legacy Strategy" instead of showing an assignment
494
- * the document never received.
495
- */
496
- revertLegacyConversion(blockId: number, previous: {
497
- strategyId: string;
498
- size: string;
499
- nodeConfigVersion: number;
500
- }): void;
501
438
  removeStrategy(): void;
502
439
  fetchRecommendationCreateData(): Promise<void>;
503
440
  fetchRecommendationFilters(): Promise<void>;
@@ -515,12 +452,6 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
515
452
  hasInvalidBlock(): boolean;
516
453
  fetchRecommendationProducts(): Promise<void>;
517
454
  _doFetchProducts(): Promise<void>;
518
- /**
519
- * Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
520
- * selected block. The legacy conversion must refresh the products of the block that
521
- * started it even after the user selected another one.
522
- */
523
- fetchStrategyProductsForBlock(blockId: number): Promise<void>;
524
455
  _doFetchStrategyProducts(blockId: number): Promise<void>;
525
456
  _setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
526
457
  }>;
@@ -2,5 +2,7 @@ export { default as Guido } from './components/Guido.vue';
2
2
  export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
3
3
  export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
4
4
  export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
5
+ export { useGuidoEmailEditorStore } from './public/editorState';
6
+ export type { GuidoEmailEditorState } from './public/editorState';
5
7
  export type { StripoEventType } from './@types/events';
6
8
  export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Published as `@useinsider/guido/editor-state` — the live editor snapshot Guido
3
+ * writes into the host's shared Pinia singleton.
4
+ *
5
+ * Importing from here pulls in nothing but pinia, so the editor never enters a
6
+ * consumer's module graph. Re-export surface only: this is the contract,
7
+ * `stores/guido-email-editor` is the implementation and stays free to move.
8
+ *
9
+ * Consumers read the store by importing it; the id `guidoEmailEditor` remains
10
+ * part of the contract for cortex-fe, which probes `pinia._s` at runtime instead
11
+ * of taking a build-time dependency on this package.
12
+ */
13
+ export { useGuidoEmailEditorStore } from '../stores/guido-email-editor';
14
+ export type { GuidoEmailEditorState } from '../stores/guido-email-editor';
@@ -4,6 +4,10 @@
4
4
  * Importing from here pulls in nothing else, so the editor never enters a
5
5
  * consumer's module graph. Re-export surface only: this is the contract,
6
6
  * `utils/linkTrackingIds` is the implementation and stays free to move.
7
+ *
8
+ * Relative, not the `@@/Utils/` alias: vue-tsc copies the specifier into the emitted
9
+ * .d.ts verbatim, and a consumer's TypeScript cannot resolve our alias table. A relative
10
+ * path resolves against dist/src/, so the published types actually load.
7
11
  */
8
- export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '@@/Utils/linkTrackingIds';
9
- export type { TrackingIdResult } from '@@/Utils/linkTrackingIds';
12
+ export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '../utils/linkTrackingIds';
13
+ export type { TrackingIdResult } from '../utils/linkTrackingIds';
@@ -1,4 +1,4 @@
1
- import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsMigrationPayload, RrsMigrationTarget, RrsStrategy } from '@@/Types/recommendation';
1
+ import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsStrategy } from '@@/Types/recommendation';
2
2
  export declare const useRecommendationApi: () => {
3
3
  fetchRecommendationCreateData: () => Promise<InitialResponse>;
4
4
  fetchRecommendationFilters: () => Promise<FiltersResponse>;
@@ -6,5 +6,4 @@ export declare const useRecommendationApi: () => {
6
6
  fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
7
7
  fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
8
8
  generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse | null>;
9
- migrateLegacyStrategy: (payload: RrsMigrationPayload, target?: RrsMigrationTarget) => Promise<string>;
10
9
  };