@useinsider/guido 3.19.0-beta.f02eaa1 → 3.19.0-beta.f0d5980

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 (72) hide show
  1. package/dist/@types/config/schemas.js +104 -91
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +86 -81
  4. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  5. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  6. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -7
  8. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +69 -52
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -44
  10. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  11. package/dist/components/organisms/header/EditorActions.vue2.js +23 -25
  12. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +3 -3
  13. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +21 -20
  14. package/dist/components/wrappers/WpModal.vue.js +1 -1
  15. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  16. package/dist/composables/useActionsApi.js +52 -47
  17. package/dist/composables/useAuthError.js +52 -0
  18. package/dist/composables/useCodeEditorApi.js +23 -9
  19. package/dist/composables/useCustomInterfaceAppearance.js +61 -51
  20. package/dist/composables/useHtmlValidator.js +87 -82
  21. package/dist/composables/useHttp.js +64 -54
  22. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  23. package/dist/composables/useRecommendation.js +40 -35
  24. package/dist/composables/useStripo.js +43 -39
  25. package/dist/composables/useToaster.js +18 -22
  26. package/dist/composables/useTranslations.js +3 -2
  27. package/dist/composables/useVersionHistoryApi.js +33 -24
  28. package/dist/composables/validators/useLiquidValidator.js +15 -15
  29. package/dist/config/migrator/index.js +14 -13
  30. package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
  31. package/dist/enums/extensions/recommendationBlock.js +43 -35
  32. package/dist/extensions/Blocks/Recommendation/block.js +65 -45
  33. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  34. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +70 -58
  35. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +133 -79
  36. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +96 -97
  37. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +212 -94
  38. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +1 -1
  39. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  40. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
  41. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  42. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  43. package/dist/guido.css +1 -1
  44. package/dist/src/@types/config/schemas.d.ts +16 -0
  45. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  46. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  47. package/dist/src/composables/useAuthError.d.ts +12 -0
  48. package/dist/src/composables/useConfig.d.ts +2 -0
  49. package/dist/src/composables/useHttp.d.ts +2 -0
  50. package/dist/src/config/migrator/index.d.ts +2 -1
  51. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  52. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  53. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  54. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  55. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +8 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -6
  59. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +92 -0
  60. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  61. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +1 -1
  62. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
  63. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  64. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  65. package/dist/src/stores/config.d.ts +20 -0
  66. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  67. package/dist/static/styles/components/recommendation-strategy.css.js +43 -4
  68. package/dist/static/styles/components/skeleton.css.js +23 -0
  69. package/dist/stores/unsubscribe.js +3 -3
  70. package/dist/utils/stripoEditorApi.js +11 -0
  71. package/dist/utils/templatePreparation.js +55 -55
  72. package/package.json +2 -1
@@ -1,34 +1,43 @@
1
- const l = [
1
+ const o = "strategy", u = [
2
2
  {
3
3
  key: "locale",
4
4
  getValue: (e) => e.language,
5
5
  getAvailableOptions: (e) => Object.keys(e.languages)
6
6
  },
7
+ {
8
+ // A block feeds from either an assigned strategy (RRS) or an algorithm (legacy).
9
+ // Only a fresh RRS block has neither, and its feed URL would otherwise be built
10
+ // from an empty algorithm path.
11
+ key: o,
12
+ getValue: (e) => e.strategyId || e.strategy
13
+ },
7
14
  {
8
15
  key: "currency",
9
16
  getValue: (e) => e.currencySettings.value,
10
17
  getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
11
18
  canBeEmpty: !0
12
19
  }
13
- ], o = "newsletter.recommendation-fill-required-fields";
14
- function c(e, n, i = l) {
20
+ ], l = "newsletter.recommendation-fill-required-fields", g = "newsletter.recommendation-assign-strategy";
21
+ function c(e, n, i = u) {
15
22
  return i.filter((t) => {
16
- var u;
23
+ var s;
17
24
  if (t.condition && !t.condition(e))
18
25
  return !1;
19
- const r = (u = t.getAvailableOptions) == null ? void 0 : u.call(t, n);
20
- if (t.canBeEmpty && (r == null ? void 0 : r.length) === 0)
26
+ const a = (s = t.getAvailableOptions) == null ? void 0 : s.call(t, n);
27
+ if (t.canBeEmpty && (a == null ? void 0 : a.length) === 0)
21
28
  return !1;
22
- const a = t.getValue(e);
23
- return a ? r !== void 0 && !r.includes(a) : !0;
29
+ const r = t.getValue(e);
30
+ return r ? a !== void 0 && !a.includes(r) : !0;
24
31
  }).map((t) => t.key);
25
32
  }
26
- function s(e, n) {
33
+ function y(e, n) {
27
34
  return c(e, n).length === 0;
28
35
  }
29
36
  export {
30
- l as REQUIRED_RECOMMENDATION_FIELDS,
31
- o as RecommendationRequiredFieldsKey,
37
+ u as REQUIRED_RECOMMENDATION_FIELDS,
38
+ g as RecommendationAssignStrategyKey,
39
+ l as RecommendationRequiredFieldsKey,
40
+ o as STRATEGY_FIELD_KEY,
32
41
  c as getInvalidFields,
33
- s as isConfigValid
42
+ y as isConfigValid
34
43
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-17b3c665]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-17b3c665]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-17b3c665]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-1f4a4044] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6bbe5862]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6bbe5862] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-926b01f5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-926b01f5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-926b01f5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
@@ -278,6 +278,14 @@ export declare const TemplateSchema: v.ObjectSchema<{
278
278
  * mount. Non-numbers still fail, like every other field in this schema.
279
279
  */
280
280
  readonly trackIdCounter: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, number>]>, 0>;
281
+ /**
282
+ * The variation's saved `recommendationCampaignUrls`, keyed by block id. A block
283
+ * that still names a strategy but has no entry here had it dropped by a
284
+ * cross-account duplicate, so Guido resets it on load (SD-151945). Omit it and
285
+ * that check is off, and so is any non-object value such as `null`, because a reset
286
+ * cannot be undone. Hosts send `[]` for an empty map.
287
+ */
288
+ readonly recommendationCampaignUrls: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnknownSchema, v.TransformAction<unknown, Record<string, unknown> | undefined>]>, undefined>;
281
289
  /** Migration-only inputs (legacy block configs) */
282
290
  readonly migration: v.OptionalSchema<v.ObjectSchema<{
283
291
  /**
@@ -701,6 +709,14 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
701
709
  * mount. Non-numbers still fail, like every other field in this schema.
702
710
  */
703
711
  readonly trackIdCounter: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, number>]>, 0>;
712
+ /**
713
+ * The variation's saved `recommendationCampaignUrls`, keyed by block id. A block
714
+ * that still names a strategy but has no entry here had it dropped by a
715
+ * cross-account duplicate, so Guido resets it on load (SD-151945). Omit it and
716
+ * that check is off, and so is any non-object value such as `null`, because a reset
717
+ * cannot be undone. Hosts send `[]` for an empty map.
718
+ */
719
+ readonly recommendationCampaignUrls: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnknownSchema, v.TransformAction<unknown, Record<string, unknown> | undefined>]>, undefined>;
704
720
  /** Migration-only inputs (legacy block configs) */
705
721
  readonly migration: v.OptionalSchema<v.ObjectSchema<{
706
722
  /**
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  id: string;
4
4
  title: string;
5
5
  description?: string;
6
+ state?: 'default' | 'primary' | 'warning' | 'danger';
6
7
  size?: 'X-small' | 'small' | 'medium' | 'large';
7
8
  footerButtonOptions?: FooterButtonGroup;
8
9
  closeButtonStatus?: boolean;
@@ -15,6 +16,7 @@ type __VLS_Slots = {} & {
15
16
  };
16
17
  declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
17
18
  description: string;
19
+ state: string;
18
20
  size: string;
19
21
  footerButtonOptions: undefined;
20
22
  closeButtonStatus: boolean;
@@ -26,6 +28,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
26
28
  "secondary-action": () => void;
27
29
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
28
30
  description: string;
31
+ state: string;
29
32
  size: string;
30
33
  footerButtonOptions: undefined;
31
34
  closeButtonStatus: boolean;
@@ -34,9 +37,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
34
37
  }>>>, {
35
38
  size: "X-small" | "small" | "medium" | "large";
36
39
  description: string;
37
- closeOnOutsideClick: boolean;
40
+ state: "default" | "primary" | "warning" | "danger";
38
41
  footerButtonOptions: FooterButtonGroup;
39
42
  closeButtonStatus: boolean;
43
+ closeOnOutsideClick: boolean;
40
44
  footerStatus: boolean;
41
45
  }>;
42
46
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -0,0 +1,12 @@
1
+ export interface AuthErrorState {
2
+ status: number;
3
+ data: Record<string, unknown> | null;
4
+ }
5
+ export declare const isPanelOrigin: (url: string) => boolean;
6
+ export declare const reportAuthError: (status: number, body: string, url: string) => void;
7
+ export declare const useAuthError: () => {
8
+ authError: import("vue").Ref<{
9
+ status: number;
10
+ data: Record<string, unknown> | null;
11
+ } | null>;
12
+ };
@@ -43,6 +43,7 @@ export declare const useConfig: () => {
43
43
  selectedUnsubscribePages: number[];
44
44
  forceRecreate: boolean;
45
45
  trackIdCounter: number;
46
+ recommendationCampaignUrls?: Record<string, unknown> | undefined;
46
47
  migration: {
47
48
  recommendationConfigs: {
48
49
  [x: string]: {
@@ -180,6 +181,7 @@ export declare const useConfig: () => {
180
181
  selectedUnsubscribePages: number[];
181
182
  forceRecreate: boolean;
182
183
  trackIdCounter: number;
184
+ recommendationCampaignUrls?: Record<string, unknown> | undefined;
183
185
  migration: {
184
186
  recommendationConfigs: {
185
187
  [x: string]: {
@@ -16,6 +16,7 @@ export interface HttpError {
16
16
  status?: number;
17
17
  statusText?: string;
18
18
  response?: Response;
19
+ authReported?: boolean;
19
20
  }
20
21
  export declare const useHttp: (defaultOptions?: HttpOptions) => {
21
22
  loading: import("vue").ComputedRef<boolean>;
@@ -65,6 +66,7 @@ export declare const useHttp: (defaultOptions?: HttpOptions) => {
65
66
  json: () => Promise<any>;
66
67
  text: () => Promise<string>;
67
68
  } | undefined;
69
+ authReported?: boolean | undefined;
68
70
  } | null>;
69
71
  hasError: import("vue").ComputedRef<boolean>;
70
72
  request: <T = unknown>(method: HttpMethod, url: string, data?: unknown, options?: HttpOptions) => Promise<HttpResponse<T>>;
@@ -1,2 +1,3 @@
1
1
  import type { LegacyRecommendationConfig } from '@@/Types/config';
2
- export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>) => Promise<string>;
2
+ import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
3
+ export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions) => Promise<string>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Empties recommendation blocks copied in from another account and stamps the
3
+ * current one, before the editor ever sees the template (SD-151945).
4
+ *
5
+ * Runs at load rather than on document change: the stamp makes it a one-time
6
+ * pass per template, the campaign-URL rule only ever applies to the loaded HTML,
7
+ * and Stripo takes the result as the original document, so nothing is dirtied.
8
+ */
9
+ export interface PartnerScopeMigrationOptions {
10
+ partnerName: string;
11
+ /** `undefined` when the host does not pass the map — the unstamped check is then off. */
12
+ campaignUrls?: Record<string, unknown>;
13
+ rrsEnabled: boolean;
14
+ }
15
+ /**
16
+ * @param html Template HTML, already normalized by `migrateRecommendation`.
17
+ * @returns Migrated HTML, or the original when no block needed a reset or a stamp.
18
+ */
19
+ export declare function migrateRecommendationPartnerScope(html: string, { partnerName, campaignUrls, rrsEnabled }: PartnerScopeMigrationOptions): string;
@@ -9,6 +9,8 @@ export declare const URLS: {
9
9
  MIGRATE_STRATEGIES_PATH: string;
10
10
  TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
11
11
  };
12
+ export declare const strategyCreatePath: () => string;
13
+ export declare const strategyEditPath: (strategyId: string | number) => string;
12
14
  export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
13
15
  export declare const QUERY_PARAMS: {
14
16
  CLIENT_ID: string;
@@ -15,6 +15,8 @@ export declare class RecommendationBlock extends Block {
15
15
  * This avoids generating a new (different) ID in onCreated().
16
16
  */
17
17
  private _pendingBlockId;
18
+ /** Ids already reset under their new name, so the deferred pass skips their stale snapshot. */
19
+ private _resetSourceIds;
18
20
  constructor();
19
21
  getId(): string;
20
22
  getIcon(): string;
@@ -73,6 +75,14 @@ export declare class RecommendationBlock extends Block {
73
75
  * in the document and finding the maximum existing ID + 1.
74
76
  */
75
77
  private _generateNextId;
78
+ /**
79
+ * Drops the "already fetched" claims of a block that arrived holding a baked id
80
+ * (saved module, paste, duplicate), so the settings panel reads its strategy again.
81
+ *
82
+ * Deferred a tick: the collision handlers rename a sibling first, and either sibling can be
83
+ * the renamed one depending on where the module was dropped (SD-149916).
84
+ */
85
+ private _scheduleArrivalReset;
76
86
  /**
77
87
  * Heals a duplicate that slipped past the create-time `_detectDuplicate`
78
88
  * scan (or that was persisted by an older template before SD-142352).
@@ -10,6 +10,7 @@
10
10
  import type { RecommendationNodeConfig, CurrencyConfig, OmnibusTextConfig } from '../types/nodeConfig';
11
11
  export declare const PRE_RRS_CONFIG_VERSION = 1;
12
12
  export declare const CURRENT_CONFIG_VERSION = 2;
13
+ export declare const RRS_CONFIG_VERSION = 2;
13
14
  /**
14
15
  * Default currency configuration
15
16
  * Uses USD as the base currency with standard formatting
@@ -10,4 +10,4 @@ export { RecommendationBlockId } from './blockIds';
10
10
  export { RecommendationControlId } from './controlIds';
11
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, PRE_RRS_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, RRS_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
@@ -70,6 +70,8 @@ export declare class RecommendationBlockControl extends CommonControl {
70
70
  * state was rebuilt with (SD-150347).
71
71
  */
72
72
  private _syncNodeConfigIfChanged;
73
+ /** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
74
+ private _isPendingStrategyIdChange;
73
75
  private _capturePendingNodeConfigWrite;
74
76
  /**
75
77
  * Accumulates the pending write into `documentModifier` without applying, so the
@@ -11,6 +11,14 @@ export declare class StrategyControl extends CommonControl {
11
11
  getTemplate(): string;
12
12
  private _strategyAction;
13
13
  onRender(): void;
14
+ /**
15
+ * Whether the document itself says this block has no strategy.
16
+ *
17
+ * Read the node, not the store: when the main control cannot resolve the block id off the
18
+ * node it never syncs the persisted config, so the store still holds defaults (empty
19
+ * strategyId) for an assigned block.
20
+ */
21
+ private _isNodeUnassigned;
14
22
  onDestroy(): void;
15
23
  private _teardown;
16
24
  private _setupButtonListeners;
@@ -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.
@@ -109,7 +107,7 @@ export interface RegenerateWithStylesOptions extends Omit<RegenerateProductRowsO
109
107
  * HTML removes the need for any post-rebuild reapply pass.
110
108
  * @param options - Configuration options for regeneration
111
109
  */
112
- export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions): void;
110
+ export declare function regenerateProductRowsWithStyles(options: RegenerateWithStylesOptions): boolean;
113
111
  /**
114
112
  * Adjusts a products array to a target size.
115
113
  * Used by ProductLayoutControl to synchronously match products to the new size
@@ -153,8 +151,11 @@ 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;
154
+ /**
155
+ * Called when the batch was actually committed. Identical products commit nothing, which
156
+ * leaves anything a caller staged into the same batch unwritten unless it applies itself.
157
+ */
158
+ onApplied?: () => void;
158
159
  }
159
160
  /**
160
161
  * Updates product content in-place without regenerating HTML structure.
@@ -165,7 +166,7 @@ export interface UpdateProductContentInPlaceOptions {
165
166
  * After updating desktop, also updates mobile container to keep them in sync.
166
167
  *
167
168
  * Falls back to false when product count changed (need to add/remove elements).
168
- * @param options - Configuration options
169
+ * @param options - Configuration options; `onApplied` fires only when a batch was committed
169
170
  * @returns true if in-place update was successful, false to fall back to full regeneration
170
171
  */
171
172
  export declare function updateProductContentInPlace(options: UpdateProductContentInPlaceOptions): boolean;
@@ -86,8 +86,11 @@ interface StoreState {
86
86
  strategies: RrsStrategy[];
87
87
  strategiesLoading: boolean;
88
88
  strategyUrlTemplates: Record<string, string>;
89
+ strategiesFetched: boolean;
90
+ strategiesSettled: boolean;
89
91
  blockStates: Record<number, PerBlockState>;
90
92
  currentRecommendationId: number | null;
93
+ strategyPanelOpen: boolean;
91
94
  configVersion: number;
92
95
  }
93
96
  export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
@@ -114,8 +117,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
114
117
  }[];
115
118
  strategiesLoading: boolean;
116
119
  strategyUrlTemplates: Record<string, string>;
120
+ strategiesFetched: boolean;
121
+ strategiesSettled: boolean;
117
122
  blockStates: Record<number, PerBlockState>;
118
123
  currentRecommendationId: number | null;
124
+ strategyPanelOpen: boolean;
119
125
  configVersion: number;
120
126
  } & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
121
127
  /**
@@ -140,8 +146,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
140
146
  }[];
141
147
  strategiesLoading: boolean;
142
148
  strategyUrlTemplates: Record<string, string>;
149
+ strategiesFetched: boolean;
150
+ strategiesSettled: boolean;
143
151
  blockStates: Record<number, PerBlockState>;
144
152
  currentRecommendationId: number | null;
153
+ strategyPanelOpen: boolean;
145
154
  configVersion: number;
146
155
  } & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
147
156
  /**
@@ -166,8 +175,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
166
175
  }[];
167
176
  strategiesLoading: boolean;
168
177
  strategyUrlTemplates: Record<string, string>;
178
+ strategiesFetched: boolean;
179
+ strategiesSettled: boolean;
169
180
  blockStates: Record<number, PerBlockState>;
170
181
  currentRecommendationId: number | null;
182
+ strategyPanelOpen: boolean;
171
183
  configVersion: number;
172
184
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
173
185
  assignStrategyDrawerStatus(state: {
@@ -189,8 +201,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
189
201
  }[];
190
202
  strategiesLoading: boolean;
191
203
  strategyUrlTemplates: Record<string, string>;
204
+ strategiesFetched: boolean;
205
+ strategiesSettled: boolean;
192
206
  blockStates: Record<number, PerBlockState>;
193
207
  currentRecommendationId: number | null;
208
+ strategyPanelOpen: boolean;
194
209
  configVersion: number;
195
210
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
196
211
  removeStrategyModalStatus(state: {
@@ -212,8 +227,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
212
227
  }[];
213
228
  strategiesLoading: boolean;
214
229
  strategyUrlTemplates: Record<string, string>;
230
+ strategiesFetched: boolean;
231
+ strategiesSettled: boolean;
215
232
  blockStates: Record<number, PerBlockState>;
216
233
  currentRecommendationId: number | null;
234
+ strategyPanelOpen: boolean;
217
235
  configVersion: number;
218
236
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
219
237
  isLegacyStrategyBlock(): boolean;
@@ -236,8 +254,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
236
254
  }[];
237
255
  strategiesLoading: boolean;
238
256
  strategyUrlTemplates: Record<string, string>;
257
+ strategiesFetched: boolean;
258
+ strategiesSettled: boolean;
239
259
  blockStates: Record<number, PerBlockState>;
240
260
  currentRecommendationId: number | null;
261
+ strategyPanelOpen: boolean;
241
262
  configVersion: number;
242
263
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
243
264
  legacyStrategyUpdatedModalStatus(state: {
@@ -259,8 +280,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
259
280
  }[];
260
281
  strategiesLoading: boolean;
261
282
  strategyUrlTemplates: Record<string, string>;
283
+ strategiesFetched: boolean;
284
+ strategiesSettled: boolean;
262
285
  blockStates: Record<number, PerBlockState>;
263
286
  currentRecommendationId: number | null;
287
+ strategyPanelOpen: boolean;
264
288
  configVersion: number;
265
289
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
266
290
  assignedStrategy(state: {
@@ -282,8 +306,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
282
306
  }[];
283
307
  strategiesLoading: boolean;
284
308
  strategyUrlTemplates: Record<string, string>;
309
+ strategiesFetched: boolean;
310
+ strategiesSettled: boolean;
285
311
  blockStates: Record<number, PerBlockState>;
286
312
  currentRecommendationId: number | null;
313
+ strategyPanelOpen: boolean;
287
314
  configVersion: number;
288
315
  } & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
289
316
  /**
@@ -308,8 +335,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
308
335
  }[];
309
336
  strategiesLoading: boolean;
310
337
  strategyUrlTemplates: Record<string, string>;
338
+ strategiesFetched: boolean;
339
+ strategiesSettled: boolean;
311
340
  blockStates: Record<number, PerBlockState>;
312
341
  currentRecommendationId: number | null;
342
+ strategyPanelOpen: boolean;
313
343
  configVersion: number;
314
344
  } & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
315
345
  /**
@@ -334,8 +364,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
334
364
  }[];
335
365
  strategiesLoading: boolean;
336
366
  strategyUrlTemplates: Record<string, string>;
367
+ strategiesFetched: boolean;
368
+ strategiesSettled: boolean;
337
369
  blockStates: Record<number, PerBlockState>;
338
370
  currentRecommendationId: number | null;
371
+ strategyPanelOpen: boolean;
339
372
  configVersion: number;
340
373
  } & import("pinia").PiniaCustomStateProperties<StoreState>): number;
341
374
  hasFilters(): boolean;
@@ -361,8 +394,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
361
394
  }[];
362
395
  strategiesLoading: boolean;
363
396
  strategyUrlTemplates: Record<string, string>;
397
+ strategiesFetched: boolean;
398
+ strategiesSettled: boolean;
364
399
  blockStates: Record<number, PerBlockState>;
365
400
  currentRecommendationId: number | null;
401
+ strategyPanelOpen: boolean;
366
402
  configVersion: number;
367
403
  } & import("pinia").PiniaCustomStateProperties<StoreState>) => {
368
404
  text: string;
@@ -387,8 +423,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
387
423
  }[];
388
424
  strategiesLoading: boolean;
389
425
  strategyUrlTemplates: Record<string, string>;
426
+ strategiesFetched: boolean;
427
+ strategiesSettled: boolean;
390
428
  blockStates: Record<number, PerBlockState>;
391
429
  currentRecommendationId: number | null;
430
+ strategyPanelOpen: boolean;
392
431
  configVersion: number;
393
432
  } & import("pinia").PiniaCustomStateProperties<StoreState>) => {
394
433
  text: string;
@@ -413,8 +452,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
413
452
  }[];
414
453
  strategiesLoading: boolean;
415
454
  strategyUrlTemplates: Record<string, string>;
455
+ strategiesFetched: boolean;
456
+ strategiesSettled: boolean;
416
457
  blockStates: Record<number, PerBlockState>;
417
458
  currentRecommendationId: number | null;
459
+ strategyPanelOpen: boolean;
418
460
  configVersion: number;
419
461
  } & import("pinia").PiniaCustomStateProperties<StoreState>) => {
420
462
  text: string;
@@ -440,6 +482,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
440
482
  /**
441
483
  * Deep-clones a block's state and mirrors its campaign URL under a new id.
442
484
  * Invoked from `onCreated` when a duplicate is detected (SD-142352).
485
+ *
486
+ * The clone keeps the source's data but drops its "already fetched / already
487
+ * synced" claims for strategy blocks, so it fetches again like a fresh drop
488
+ * (SD-149916).
443
489
  */
444
490
  cloneBlockState(sourceId: number, newId: number): void;
445
491
  /**
@@ -497,6 +543,47 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
497
543
  openRemoveStrategyModal(): void;
498
544
  closeRemoveStrategyModal(): void;
499
545
  fetchStrategies(): Promise<void>;
546
+ /**
547
+ * Clears what a block inherited from the id it arrived holding, so the panel fetches for it.
548
+ * A re-dropped saved module can keep the source's id — and its "already fetched" entry —
549
+ * while the strategy's product count has moved on (SD-149916).
550
+ */
551
+ resetArrivedBlock(id: number): void;
552
+ invalidateStrategies(): void;
553
+ /**
554
+ * Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
555
+ * the user comes back. `visibilitychange` only: a `focus` listener would also fire when
556
+ * focus merely returns from the Stripo canvas iframe to the panel, refetching and
557
+ * regenerating the canvas while the user never left the editor (SD-149916).
558
+ *
559
+ * Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
560
+ * strategy in it and come back again — a listener that disarmed on the first return would
561
+ * leave that one missing from the list. It disarms on the first return AFTER that tab is
562
+ * closed instead, so an ordinary alt-tab later in the session costs nothing. Armed only
563
+ * once the user actually opens a strategy page, so anyone who never does pays nothing.
564
+ * @returns whether a tab actually opened, so callers can skip work that assumes one did
565
+ */
566
+ _armStrategyPageReturn(url: string): boolean;
567
+ /**
568
+ * Reloads the products of the block the user is on, so an edit made in the strategy tab
569
+ * lands on the canvas instead of waiting for the assign drawer to be reopened.
570
+ *
571
+ * Only the selected block: the canvas regeneration is driven off the active block's
572
+ * product array, so refreshing an unselected block would fetch without redrawing it.
573
+ */
574
+ _refreshAssignedStrategyProducts(): Promise<void>;
575
+ /** Lets the editor tear the return listeners down when it unmounts. */
576
+ disposeStrategyPageReturn(): void;
577
+ /**
578
+ * Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
579
+ * new strategy is offered; the user picks it themselves.
580
+ */
581
+ openStrategyCreation(): boolean;
582
+ /**
583
+ * Opens the strategy's edit page. Every return refreshes the list so the block reflects the
584
+ * edited configuration.
585
+ */
586
+ openStrategyEdit(strategyId: string | number): boolean;
500
587
  resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
501
588
  assignStrategy(strategy: RrsStrategy): void;
502
589
  convertLegacyStrategy(payload: RrsMigrationPayload, target?: RrsMigrationTarget): Promise<string>;
@@ -525,6 +612,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
525
612
  * every block's recommendationConfigs across user edits.
526
613
  */
527
614
  hasInvalidBlock(): boolean;
615
+ /**
616
+ * Which required fields are missing across the design's blocks, so the save
617
+ * toaster can name the cause instead of always showing the generic message.
618
+ */
619
+ invalidBlockFields(): string[];
528
620
  fetchRecommendationProducts(): Promise<void>;
529
621
  _doFetchProducts(): Promise<void>;
530
622
  /**
@@ -83,6 +83,12 @@ export interface RecommendationNodeConfig {
83
83
  */
84
84
  filters: Filter[];
85
85
  strategyId: string;
86
+ /**
87
+ * Account (`config.partner.name`) that last wrote the strategy config. Strategy ids and
88
+ * attribute types are account-scoped, so a block opened under another account is reset.
89
+ * Absent on blocks saved before SD-151945.
90
+ */
91
+ partnerName?: string;
86
92
  /**
87
93
  * Layout orientation
88
94
  * - 'grid': Products in a grid, attributes aligned across products
@@ -2,7 +2,7 @@ import type { RrsMigrationPayload, RrsMigrationTarget } from '@@/Types/recommend
2
2
  /**
3
3
  * A block authored before reusable strategies: it still carries a plain feed
4
4
  * configuration (compiled into a feed URL string) instead of a strategy id.
5
- * Blocks created under RRS stamp `CURRENT_CONFIG_VERSION`, so the version is
5
+ * Blocks created under RRS stamp at least `RRS_CONFIG_VERSION`, so the version is
6
6
  * what separates "never converted" from "not assigned yet".
7
7
  */
8
8
  export declare function isLegacyStrategyConfig({ strategyId, nodeConfigVersion }: {
@@ -0,0 +1,33 @@
1
+ import type { RecommendationNodeConfig } from '../types/nodeConfig';
2
+ /**
3
+ * Mirrors the backend's `RecommendationCampaignUrls::isDefined`: a legacy feed URL
4
+ * string or an entry that names a strategy.
5
+ */
6
+ export declare function isDefinedCampaignUrl(value: unknown): boolean;
7
+ export interface PartnerScopeInputs {
8
+ config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
9
+ blockId: number;
10
+ partnerName: string;
11
+ /** `undefined` when the host does not pass the map — the unstamped check is then off. */
12
+ campaignUrls: Record<string, unknown> | undefined;
13
+ /** With RRS off `buildCampaignUrl` drops the block's map entry, so the map says nothing. */
14
+ rrsEnabled: boolean;
15
+ }
16
+ /**
17
+ * Whether a block carries another account's strategy config (SD-151945).
18
+ *
19
+ * A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
20
+ * falls back to the backend's own signal: a cross-account duplicate drops the block's
21
+ * strategy entry from the campaign URL map but leaves the HTML untouched. That signal
22
+ * only holds while RRS is on, and only for the HTML the host loaded — which is what
23
+ * the caller, a load-time migrator, runs on.
24
+ */
25
+ export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls, rrsEnabled }: PartnerScopeInputs): boolean;
26
+ /**
27
+ * Whether an unstamped block's ownership can be decided at all. `carriesForeignPartnerConfig`
28
+ * answers `false` both for "clean" and for "cannot tell", and stamping on the latter would
29
+ * record a foreign block as this account's and silence every later check. A block with no
30
+ * strategy reference has nothing foreign to carry, so it is always decidable.
31
+ */
32
+ export declare function canJudgeUnstampedBlock({ config, campaignUrls, rrsEnabled }: Pick<PartnerScopeInputs, 'config' | 'campaignUrls' | 'rrsEnabled'>): boolean;
33
+ export declare function withoutCustomAttributes(composition: string[]): string[];